Back to Devexpress

Session.GetClassInfo<ClassType>() Method

xpo-devexpress-dot-xpo-dot-session-dot-getclassinfo-1.md

latest5.5 KB
Original Source

Session.GetClassInfo<ClassType>() Method

Returns the XPClassInfo for the type designated by the specified generic type parameter.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public XPClassInfo GetClassInfo<ClassType>()
vb
Public Function GetClassInfo(Of ClassType) As XPClassInfo

Type Parameters

Name
ClassType

Returns

TypeDescription
XPClassInfo

An XPClassInfo object which provides metadata information for a class of the specified type.

|

Remarks

This method retrieves metadata information via the Session.Dictionary. If the metadata cannot be obtained from a class of the specified type, the CannotResolveClassInfoException is thrown.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetClassInfo<ClassType>() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-bind-wpf-grid-to-data/CS/CodeBehind/XPO/PagedAsyncSource/MainWindow.xaml.cs#L17

csharp
using(var session = new Session()) {
    var classInfo = session.GetClassInfo<Issue>();
    var properties = classInfo.Members

wpf-data-grid-implement-crud-operations/CS/CodeBehind/XPO/PagedAsyncSource/MainWindow.xaml.cs#L17

csharp
using(var session = new Session()) {
    var classInfo = session.GetClassInfo<Issue>();
    var properties = classInfo.Members

XPO_how-to-implement-odata4-service-with-xpo-netcore/CS/ODataService/Helpers/ApiHelper.cs#L34

csharp
}
var classInfo = uow.GetClassInfo<TEntity>();
var memberInfo = classInfo.FindMember(navigationProperty);

XPO_how-to-implement-odata4-service-with-xpo/CS/ODataService/Helpers/ApiHelper.cs#L43

csharp
}
var classInfo = uow.GetClassInfo<TEntity>();
var memberInfo = classInfo.FindMember(navigationProperty);

XPO_how-to-bind-data-to-winforms-controls-using-xpbindingsource/CS/DXApplication/Form1.cs#L63

csharp
ProductListSource.DataSource = UnitOfWork.Query<Products>().ToList();
ProductListSource.ObjectClassInfo = UnitOfWork.GetClassInfo<Products>();
break;

how-to-bind-wpf-grid-to-data/VB/CodeBehind/XPO/InfiniteAsyncSource/MainWindow.xaml.vb#L14

vb
Using session = New Session()
    Dim classInfo = session.GetClassInfo(Of Issue)()
    Dim properties = classInfo.Members.Where(Function(member) member.IsPublic AndAlso member.IsPersistent).[Select](Function(member) member.Name).ToArray()

XPO_how-to-generate-a-sequential-number-for-a-business-object-within-a-database-transaction-e2620/VB/ExplicitUnitOfWorkDemo/SequenceGenerator.vb#L17

vb
euow = New ExplicitUnitOfWork(dataLayer)
    classInfo = euow.GetClassInfo(Of T)()
End Sub

XPO_how-to-bind-data-to-winforms-controls-using-xpbindingsource/VB/DXApplication/Form1.vb#L52

vb
ProductListSource.DataSource = UnitOfWork.Query(Of Products)().ToList()
    ProductListSource.ObjectClassInfo = UnitOfWork.GetClassInfo(Of Products)()
Case "Single Object"

See Also

Session Class

Session Members

DevExpress.Xpo Namespace