xpo-devexpress-dot-xpo-dot-metadata-dot-xpdictionary-dot-getclassinfo-x28-system-dot-type-x29.md
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
public XPClassInfo GetClassInfo(
Type classType
)
Public Function GetClassInfo(
classType As Type
) As XPClassInfo
| Name | Type | Description |
|---|---|---|
| classType | Type |
The class type.
|
| Type | Description |
|---|---|
| XPClassInfo |
The XPClassInfo for the specified class type.
|
This method throws the CannotResolveClassInfoException whenever the metadata information cannot be obtained for the specified class type; for example, if the corresponding class does not implement IXPSimpleObject an exception is thrown.
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetClassInfo(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-persist-metadata-e269/CS/MetadataObjects.cs#L57
else
baseClassInfo = dictionary.GetClassInfo(GetDefaultBaseClass());
result = dictionary.CreateClass(baseClassInfo, Name);
Guard.ArgumentNotNull(typeInfo, "typeInfo");
return GetNextSequence(XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary.GetClassInfo(typeInfo.Type));
}
XPO_how-to-define-a-persistent-class-at-runtime-e1139/CS/CreateClassAtRuntime/Program.cs#L16
XPDictionary dictionary = new ReflectionDictionary();
XPClassInfo myBaseClass = dictionary.GetClassInfo(typeof(MyBaseObject));
XPClassInfo myClassA = dictionary.CreateClass(myBaseClass, "MyObjectA");
XPClassInfo ci = XpoDefault.DataLayer.Dictionary.GetClassInfo(typeof(TestClass));
ci.CreateAliasedMember("DisplayName", typeof(string), "concat([Name],' (',[Email],')',iif([Master] is null,'',Concat(' managed by ',[Master].Name)))");
throw new NotSupportedException("Compound primary keys are not supported");
XPClassInfo classInfo = dict.CreateClass(dict.GetClassInfo(typeof(BasePersistentClass)), table.Name.Replace('.', '_'));
classInfo.AddAttribute(new PersistentAttribute(table.Name));
XPO_how-to-persist-metadata-e269/VB/MetadataObjects.vb#L80
Else
baseClassInfo = dictionary.GetClassInfo(GetDefaultBaseClass())
End If
winforms-filtercontrol-implement-ifilteredcomponent/VB/Q200298/Helper.vb#L144
Dim dict As XPDictionary = CType(sourceField, IXPDictionaryProvider).Dictionary
Dim cInfo As XPClassInfo = dict.GetClassInfo(member.MemberType)
If Equals(element, "!Key") Then element = cInfo.KeyProperty.Name
See Also