Back to Devexpress

XPDictionary.QueryClassInfo(Type) Method

xpo-devexpress-dot-xpo-dot-metadata-dot-xpdictionary-dot-queryclassinfo-x28-system-dot-type-x29.md

latest4.3 KB
Original Source

XPDictionary.QueryClassInfo(Type) Method

When implemented by a class, returns the persistent class metadata information for the specified class type.

Namespace : DevExpress.Xpo.Metadata

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public abstract XPClassInfo QueryClassInfo(
    Type classType
)
vb
Public MustOverride Function QueryClassInfo(
    classType As Type
) As XPClassInfo

Parameters

NameTypeDescription
classTypeType

The class type.

|

Returns

TypeDescription
XPClassInfo

The XPClassInfo object for the specified class type or null reference ( Nothing in Visual Basic) when the metadata information for the corresponding class cannot be obtained.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the QueryClassInfo(Type) 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.

XPO_how-to-generate-persistent-classes-at-runtime-based-on-a-dataset-e1198/CS/WindowsApplication4/Form1.cs#L25

csharp
DBTable table = tables[0];
XPClassInfo info = XpoDefault.Dictionary.CreateClass(XpoDefault.Dictionary.QueryClassInfo(baseType), table.Name);
string key = table.PrimaryKey.Columns[0];

XPO_how-to-create-an-xpclassinfo-descendant-to-dynamically-build-a-persistent-class-structure-e1729/CS/DynamicDataTable/DynamicDataTableClassInfo.cs#L15

csharp
if (table.PrimaryKey.Length != 1) throw new NotSupportedException();
baseClassCore = dictionary.QueryClassInfo(typeof(XPDataTableObject));
tableNameCore = table.TableName;

XPO_how-to-generate-persistent-classes-at-runtime-based-on-a-dataset-e1198/VB/WindowsApplication4/Form1.vb#L24

vb
Dim table As DBTable = tables(0)
Dim info As XPClassInfo = XpoDefault.Dictionary.CreateClass(XpoDefault.Dictionary.QueryClassInfo(baseType), table.Name)
Dim key As String = table.PrimaryKey.Columns(0)

XPO_how-to-create-an-xpclassinfo-descendant-to-dynamically-build-a-persistent-class-structure-e1729/VB/DynamicDataTable/DynamicDataTableClassInfo.vb#L19

vb
End If
baseClassCore = dictionary.QueryClassInfo(GetType(XPDataTableObject))
tableNameCore = table.TableName

See Also

QueryClassInfo

GetClassInfo

XPDictionary Class

XPDictionary Members

DevExpress.Xpo.Metadata Namespace