Skip to main content
.NET 6.0+

Session.DropChanges() Method

Discards changes made to persistent objects and clears a list of tracked changes.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public void DropChanges()

Remarks

Call this method to discard any changes made to persistent objects after the Session.TrackingChanges property has been set to true. To retain changes and clear a list of tracked changes, call the Session.FlushChanges or Session.FlushChangesAsync method.

When a list of tracked changes is about to be cleared, the Session.BeforeDropChanges event is raised. After a list of tracked changes has been cleared, the Session.AfterDropChanges event is raised.

Important

An object’s state, modified within a transaction, is not automatically returned to its former state by the DropChanges method call. In order to refresh the object’s state, use the XPBaseObject.Reload method.

Note

Calling the DropChanges method sets the Session.TrackingChanges property to false. This method is automatically called when a session or unit of work rolls back a transaction.

See Also