.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

IObjectSpace.Delete(Object) Method

Marks the specified persistent object and its aggregated objects as deleted from persistent storage.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll


void Delete(
    object obj
Sub Delete(
    obj As Object


Name Type Description
obj Object

An object which is the persistent object to be deleted.


Use this method to delete the object specified as the parameter from the database. Note, that the object is not deleted immediately. It is only marked as an object to be deleted during the next call of the IObjectSpace.CommitChanges method.

When implementing the IObjectSpace interface in the BaseObjectSpace class's descendant, you don't have to implement the Delete method. It's implemented by the BaseObjectSpace class. In this method, the IObjectSpace.CustomDeleteObjects event is raised, a protected virtual BaseObjectSpace.DeleteCore method is invoked and then the current Object Space is set as modified. So, you should only override the BaseObjectSpace.DeleteCore method to delete the specified object using the container for in-memory objects (e.g. XPObjectSpace.Session in the case of an XPObjectSpace or EFObjectSpace.ObjectContext in the case of an XPObjectSpace).

After using this method, the Object Space's IObjectSpace.IsModified property is set to true.

See Also