Delen via


IConventionProperty.SetIsConcurrencyToken Method

Definition

Sets a value indicating whether this property is used as a concurrency token. When a property is configured as a concurrency token the value in the database will be checked when an instance of this entity type is updated or deleted during SaveChanges() to ensure it has not changed since the instance was retrieved from the database. If it has changed, an exception will be thrown and the changes will not be applied to the database.

public void SetIsConcurrencyToken (bool? concurrencyToken, bool fromDataAnnotation = false);
public bool? SetIsConcurrencyToken (bool? concurrencyToken, bool fromDataAnnotation = false);
abstract member SetIsConcurrencyToken : Nullable<bool> * bool -> unit
abstract member SetIsConcurrencyToken : Nullable<bool> * bool -> Nullable<bool>
Public Sub SetIsConcurrencyToken (concurrencyToken As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false)
Public Function SetIsConcurrencyToken (concurrencyToken As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As Nullable(Of Boolean)

Parameters

concurrencyToken
Nullable<Boolean>

Sets a value indicating whether this property is used as a concurrency token. null to reset to default.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to