Table of Contents

Class OptimisticLockPropertyAttribute

Namespace
LinqToDB.Concurrency
Assembly
linq2db.dll

Implements built-in optimistic lock value generation strategies for updates. See VersionBehavior for supported strategies. Used with ConcurrencyExtensions extensions.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class OptimisticLockPropertyAttribute : OptimisticLockPropertyBaseAttribute, _Attribute
Inheritance
OptimisticLockPropertyAttribute
Implements
Inherited Members
Extension Methods

Constructors

OptimisticLockPropertyAttribute(VersionBehavior)

public OptimisticLockPropertyAttribute(VersionBehavior behavior)

Parameters

behavior VersionBehavior

Properties

Behavior

Version column value generation strategy.

public VersionBehavior Behavior { get; }

Property Value

VersionBehavior

Methods

GetNextValue(ColumnDescriptor, ParameterExpression)

Implements generation of update value expression for current optimistic lock column.

public override LambdaExpression? GetNextValue(ColumnDescriptor column, ParameterExpression record)

Parameters

column ColumnDescriptor

Column mapping descriptor.

record ParameterExpression

Updated record.

Returns

LambdaExpression

null to skip explicit column update or update expression.

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string