来源:https://www.devexpress.com/Support/Center/Question/Details/A2944
1. Always define a constructor with a Session parameter in your persistent objects.
This will help you prepare for point 4 (see below) and will also allow you to avoid the exception explained in the A751 article.
[C#]
public class OrderDetail : XPObject { public OrderDetail(Session session) : base(session) { } // ... }
[VB.NET]
Public Class OrderDetail Inherits XPObject Public Sub New(ByVal session As Session) MyBase.New(session) End Sub ' ... End Class