Back to Devexpress

DeferredDeletionAttribute Class

xpo-devexpress-dot-xpo-4532556e.md

latest2.5 KB
Original Source

DeferredDeletionAttribute Class

Enables deferred object deletion.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true)]
public sealed class DeferredDeletionAttribute :
    Attribute
vb
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface, Inherited:=True)>
Public NotInheritable Class DeferredDeletionAttribute
    Inherits Attribute

Remarks

Deferred deletion means that when you delete a persistent object by calling its XPBaseObject.Delete method, XPO does not physically delete the record in the underlying data store. Instead, it marks the record as deleted.

For detailed information, see Deleting Persistent Objects.

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.

  • This attribute affects service member generation (see When and Why XPO Extends the Database Schema). If it needs to be applied to a dynamically created class, pass this attribute in the XPDictionary.CreateClass method arguments instead of adding it afterwards.

Inheritance

Object Attribute DeferredDeletionAttribute

See Also

DeferredDeletionAttribute Members

Built-In Attributes

Delete Persistent Objects

DevExpress.Xpo Namespace