Table of Contents

Class OptimisticLockingAttribute

Namespace
DevExpress.Xpo
Assembly
DevExpress.Xpo.v24.1.dll

Specifies that a persistent object’s state can be locked during a session.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface, Inherited = true)]
public sealed class OptimisticLockingAttribute : Attribute
Inheritance
OptimisticLockingAttribute
Inherited Members

Constructors

OptimisticLockingAttribute()

Initializes a new instance of the OptimisticLockingAttribute class with default settings.

public OptimisticLockingAttribute()

OptimisticLockingAttribute(OptimisticLockingBehavior)

Initializes a new instance of the OptimisticLockingAttribute class with the specified OptimisticLockingAttribute.LockingKind property.

public OptimisticLockingAttribute(OptimisticLockingBehavior lockingKind)

Parameters

lockingKind OptimisticLockingBehavior

An OptimisticLockingBehavior enumeration value that specifies the locking behavior.

OptimisticLockingAttribute(bool)

Initializes a new instance of the OptimisticLockingAttribute class with the specified OptimisticLockingAttribute.Enabled property.

public OptimisticLockingAttribute(bool enabled)

Parameters

enabled bool

true to enable optimistic locking; otherwise, false. This value is assigned to the OptimisticLockingAttribute.Enabled property.

OptimisticLockingAttribute(string)

Initializes a new instance of the OptimisticLockingAttribute class with the specified field name.

public OptimisticLockingAttribute(string fieldName)

Parameters

fieldName string

A string that specifies the name of a system field. This value is assigned to the OptimisticLockingAttribute.FieldName property.

Fields

DefaultFieldName

Specifies the default name of a system field which is used to control object locking for objects that have the object locking option enabled.

public const string DefaultFieldName = "OptimisticLockField"

Field Value

string

Properties

Enabled

Gets or sets whether optimistic locking is enabled.

public bool Enabled { get; set; }

Property Value

bool

true to enable optimistic locking; otherwise, false.

FieldName

Gets the name of the system field which is used to control object locking for objects that have the object locking option enabled.

public string FieldName { get; }

Property Value

string

A string value that specifies the name of a system field.

LockingKind

Specifies the locking behavior.

public OptimisticLockingBehavior LockingKind { get; set; }

Property Value

OptimisticLockingBehavior

An OptimisticLockingBehavior enumeration value that specifies the locking behavior.