Deletes the specified persistent objects and their aggregated objects from the database.
A collection of persistent objects to be deleted from the database.
Use this method to delete the objects passed as the parameter from the database. Note, that the objects are not deleted immediately. They are only marked as objects to be deleted during the next call of the IObjectSpace.CommitChanges method.
In the BaseObjectSpace descendant, the Delete method is implemented. 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 objects 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 this method call, the Object Space’s IObjectSpace.IsModified property is set to true.
Use the following code in a controller to delete all objects from the List View collection: