xpo-devexpress-dot-xpo-dot-metadata-ff96a63b.md
Serves as a base for classes that provide metadata information for a class.
Namespace : DevExpress.Xpo.Metadata
Assembly : DevExpress.Xpo.v25.2.dll
NuGet Package : DevExpress.Xpo
public abstract class XPClassInfo :
XPTypeInfo,
IXPClassInfoProvider,
IXPDictionaryProvider
Public MustInherit Class XPClassInfo
Inherits XPTypeInfo
Implements IXPClassInfoProvider,
IXPDictionaryProvider
The following members return XPClassInfo objects:
Show 41 links
The following sample code shows how to create custom fields using the XPClassInfo.CreateMember method.
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;
// ...
XPClassInfo customerClassInfo = Session.DefaultSession.GetClassInfo(typeof(Customer));
customerClassInfo.CreateMember("Name", typeof(string));
customerClassInfo.CreateMember("CompanyName", typeof(string));
// Set the nonPersistent parameter to true for collection properties
customerClassInfo.CreateMember("Orders", typeof(XPCollection), true,
new AssociationAttribute("CustomerOrders", typeof(Order)), new AggregatedAttribute());
Imports DevExpress.Xpo
Imports DevExpress.Xpo.Metadata
' ...
Dim customerClassInfo As XPClassInfo = Session.DefaultSession.GetClassInfo(GetType(Customer))
customerClassInfo.CreateMember("Name", GetType(String))
customerClassInfo.CreateMember("CompanyName", GetType(String))
' Set the nonPersistent parameter to True for collection properties
customerClassInfo.CreateMember("Orders", GetType(XPCollection), True, _
New AssociationAttribute("CustomerOrders", GetType(Order)), New AggregatedAttribute())
Object XPTypeInfo XPClassInfo ReflectionClassInfo
See Also
How to create persistent metadata on the fly and load data from an arbitrary table
How to create an XPClassInfo descendant to dynamically build a persistent class structure
How to create persistent classes mapped to tables with a composite primary key at runtime
How to create collection properties with associations at runtime
How to Generate persistent metadata for an arbitrary data table
How to generate persistent classes at runtime based on a dataset
How to get a list of a persistent object's properties
How to define a persistent class at runtime
How to dynamically create a read-only calculated (persistent alias) property