Skip to main content
All docs
V24.1
.NET 6.0+

XAF0028: Use the corresponding XPO attribute

Severity: Warning

Do not decorate members of an XPO class with attributes from the DevExpress.ExpressApp.DC namespace. These attributes are intended to be used with non-persistent classes only. Use corresponding XPO attributes instead.

Consider the following popular replacements for XAF ORM-agnostic attributes in XPO classes:

Attribute Replacement
DevExpress.ExpressApp.Data.KeyAttribute DevExpress.Xpo.KeyAttribute
DevExpress.ExpressApp.DC.FieldSizeAttribute DevExpress.Xpo.SizeAttribute
DevExpress.ExpressApp.DC.AggregatedAttribute DevExpress.Xpo.AggregatedAttribute
DevExpress.ExpressApp.DC.CalculatedAttribute DevExpress.Xpo.PersistentAliasAttribute

Examples

Invalid Code

using DevExpress.Xpo;

namespace TestApplication.Module.BusinessObjects {
    public class TestClass : XPObject {
        [DevExpress.ExpressApp.DC.FieldSize(1000)]
        public string Description { get; set; }
    }
}

Valid Code

using DevExpress.Xpo;

namespace TestApplication.Module.BusinessObjects {
    public class TestClass : XPObject {
        public TestClass(Session session) : base(session) { }
        [Size(1000)]
        public string Description { get; set; }
    }
}