Skip to main content
All docs
V24.2
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XAF0016: Descendants of NonPersistentBaseObject and NonPersistentLiteObject must be decorated with the DomainComponent attribute

Severity: Error

XAF requires that the NonPersistentBaseObject and NonPersistentLiteObject descendants must be decorated with the DomainComponentAttribute attribute

#Examples

#Invalid Code

using DevExpress.Xpo; 

namespace MySolution.Module.BusinessObjects{ 
    // Descendant of NonPersistentBaseObject must be decorated with the DomainComponentAttribute
    public class NonPersistentBaseObjectWithoutDomainComponent : NonPersistentBaseObject {}

    // Descendant of NonPersistentLiteObject must be decorated with the DomainComponentAttribute
    public class NonPersistentLiteObjectWithoutDomainComponent : NonPersistentLiteObject {}
}

#Valid Code

using DevExpress.Xpo;
using DevExpress.ExpressApp.DC;

namespace MySolution.Module.BusinessObjects {
    [DomainComponent]
    public class NonPersistentBaseObjectWithDomainComponent : NonPersistentBaseObject {}

    [DomainComponent]
    public class NonPersistentLiteObjectWithDomainComponent : NonPersistentLiteObject {}
}

#How to Fix

Decorate the NonPersistentBaseObject and NonPersistentLiteObject descendants with the DomainComponentAttribute

See Also