Provides access to a Session that is used to load and save persistent objects.
A DevExpress.Xpo.Session object which is used by the current Object Space to load and save persistent objects.
In XAF, you can use either XPO or Entity Framework as a data layer. To interact with data in terms of persistent objects on a level independent from the data layer that is currently used by the application, an Object Space is used. The Object Space of the XPObjectSpace type is wrapper of the XPO Session. When you use members of XPObjectSpace to retrieve, access and manipulate with data, the Object Space actually uses its Session instance. This property provides access to the Session used by the current Object Space. So, you are not limited to using the Session members directly. The Session object represents a cache of the persistent objects that have been instantiated during data manipulations with a data store. Actually, XAF uses a UnitOfWork that inherits the base functionality from the Session class, but provides a useful capability. When working with Sessions, you need to save each persistent object individually. While working with Units of Work, all the changes made to persistent objects are automatically saved to the database by making a single method call (see BaseObjectSpace.CommitChanges). This happens because it tracks every change to every persistent object. For details, refer to the Session and Unit of Work topics from the XPO documentation.