Skip to main content
All docs
V25.1
  • .NET 8.0+
    • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

    OptimisticLockAttribute Class

    Applies to EF Core business class properties. Specifies concurrency options.

    Namespace: DevExpress.ExpressApp.DC

    Assembly: DevExpress.ExpressApp.v25.1.dll

    NuGet Package: DevExpress.ExpressApp

    Declaration

    [AttributeUsage(AttributeTargets.Class, Inherited = true)]
    public class OptimisticLockAttribute :
        Attribute

    Remarks

    Use OptimisticLockAttribute to specify concurrency control options in a business class of an EF Core-based XAF application.

    The following code snippet uses OptimisticLockAttribute:

    using Microsoft.EntityFrameworkCore;
    
    namespace MainDemo.Module.BusinessObjects;
    
    [OptimisticLock(OptimisticLockDetection = OptimisticLockDetection.AllFields,OptimisticLockHandling = OptimisticLockHandling.Reload)]
    public class Department : BaseObject, ITreeNode {
        //...
    }
    

    For more information about optimistic concurrency control in EF Core-based XAF applications, refer to the following help topic: Optimistic Locking (Concurrency Control in EF Core).

    Inheritance

    Object
    Attribute
    OptimisticLockAttribute
    See Also