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.Delete(ICollection) Method

Deletes the specified persistent objects and their aggregated objects from the data store.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public void Delete(
    ICollection objects
)
Public Sub Delete(
    objects As ICollection
)
public void Delete(
    ICollection objects
)
Public Sub Delete(
    objects As ICollection
)

Parameters

Name Type Description
objects ICollection

A collection of persistent objects to delete from the data store.

Parameters

Name Type Description
objects ICollection

A collection of persistent objects to delete from the data store.

Remarks

If the persistent object has the DeferredDeletionAttribute, the Delete method doesn't actually remove the underlying database record. Instead, it marks the record as deleted and writes a reference to this object for later use by the Session.PurgeDeletedObjects method. You should clear all references to the object to be deleted. Otherwise, the object will not be purged. To persist the deleted state, save the object by calling its XPBaseObject.Save method.

If the DeferredDeletionAttribute isn't specified, the Delete method removes the underlying database record which corresponds to the persistent object unless there are references to this object.

Note

When an object with Deferred Deletion enabled is deleted, it is removed from associated collections. Associations cannot be recreated automatically when you restore a deleted object. This behavior is by design, because the Deferred Deletion feature is not intended for object restoration, but for overcoming complex foreign index constraints at the database level.

See Also