Skip to main content
A newer version of this page is available. .

UnitOfWork Class

Maintains a list of persistent objects that are affected by a transaction. Keeps track of every change to every persistent object during a transaction that can affect a data store. See Unit of Work.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v18.2.dll

Declaration

[ToolboxTabName("DX.18.2: ORM Components")]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "UnitOfWork")]
public class UnitOfWork :
    Session

Remarks

A unit of work maintains a list of persistent objects that are affected by a transaction. It keeps track of every change to every persistent object during a transaction that can affect a data store. With a single call to the UnitOfWork.CommitChanges method, all the changes made to persistent objects are automatically saved to a data store. While working with common sessions, you need to save each persistent object individually. The only requirement for this is that the property setters call the XPBaseObject.OnChanged method.

For more information and examples, see Unit of Work.

Implements

See Also