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.GetObjectsToDelete(Boolean) Method

Returns a collection of persistent objects that will be deleted when the current transaction is committed, including objects that will be deleted in the parent transaction(s), optionally.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public virtual ICollection GetObjectsToDelete(
    bool includeParent
)
Public Overridable Function GetObjectsToDelete(
    includeParent As Boolean
) As ICollection
public virtual ICollection GetObjectsToDelete(
    bool includeParent
)
Public Overridable Function GetObjectsToDelete(
    includeParent As Boolean
) As ICollection

Parameters

Name Type Description
includeParent Boolean

true, to include persistent objects that will be deleted in the parent transaction(s); otherwise, false.

Parameters

Name Type Description
includeParent Boolean

true, to include persistent objects that will be deleted in the parent transaction(s); otherwise, false.

Returns

Type Description
ICollection

The collection of persistent objects that will be deleted when the current transaction is committed.

Returns

Type Description
ICollection

The collection of persistent objects that will be deleted when the current transaction is committed.

Remarks

The GetObjectsToDelete method returns a collection of persistent objects that will be deleted only when the current transaction is committed. It is overridden in the NestedUnitOfWork class to return persistent objects that will be deleted in the parent transaction(s), optionally. For general information on deleting persistent objects, see Deleting Persistent Objects.

Objects that have Deferred Deletion enabled are actually modified upon deletion. So, they appear in the collection returned by the Session.GetObjectsToSave method, not in the collection returned by the Session.GetObjectsToDelete method.

The Session.GetObjectsToSave and Session.GetObjectsToDelete methods do not create new collection instances and fill them with objects when called. Instead, these methods return references to internal collections whose content changes throughout the life cycle of a Session.


ICollection changedObjects = myUnitOfWork.GetObjectsToSave();
int count = changedObject.Count; // 'count' is an arbitrary number
myUnitOfWork.CommitChanges();
count = changedObject.Count; // here, 'count' always equals zero
See Also