The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Session.DropChanges() Method

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

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public void DropChanges()
Public Sub DropChanges
public void DropChanges()
Public Sub 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