Skip to main content

XPClassInfo Class

Serves as a base for classes that provide metadata information for a class.

Namespace: DevExpress.Xpo.Metadata

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public abstract class XPClassInfo :
    XPTypeInfo,
    IXPClassInfoProvider,
    IXPDictionaryProvider

Example

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());
See Also