expressappframework-403423-debugging-testing-and-error-handling-code-diagnostics-xaf0003.md
Severity: Warning
XAF requires that the XPO business object’s class should be public. Otherwise, it is not recognized as a business object.
This diagnostic works only for XPO classes derived from the DevExpress.Xpo.PersistentBase class. This diagnostics does not work for abstract classes.
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
namespace MySolution.Module.BusinessObjects{
// The class must be public
//[DefaultClassOptions]
//class ExampleObject1 : BaseObject { // Warning: XAF0003
// public ExampleObject1(Session session) : base(session) {}
//}
// The class must be public
//[DefaultClassOptions]
//private class ExampleObject2 : BaseObject { // Warning: XAF0003
// public ExampleObject1(Session session) : base(session) {}
//}
// ...
}
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
namespace MySolution.Module.BusinessObjects{
// This class meets the requirements
[DefaultClassOptions]
public class ExampleObject1 : BaseObject {
public ExampleObject1(Session session) : base(session) {}
// ...
}
}
Declare the business object’s class with the public keyword.