Skip to main content
A newer version of this page is available. .
All docs
V22.2
.NET Framework 4.5.2+

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; }
    }
}