Back to Devexpress

OptimisticLockAttribute Class

expressappframework-devexpress-dot-expressapp-dot-dc-a295c4bc.md

latest2.2 KB
Original Source

OptimisticLockAttribute Class

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

Namespace : DevExpress.ExpressApp.DC

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
public class OptimisticLockAttribute :
    Attribute
vb
<AttributeUsage(AttributeTargets.Class, Inherited:=True)>
Public Class OptimisticLockAttribute
    Inherits 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:

csharp
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

OptimisticLockAttribute Members

DevExpress.ExpressApp.DC Namespace