IConventionPropertyBuilder.IsConcurrencyToken Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Configures whether this property should be 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 Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder IsConcurrencyToken (bool? concurrencyToken, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? IsConcurrencyToken (bool? concurrencyToken, bool fromDataAnnotation = false);
abstract member IsConcurrencyToken : Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function IsConcurrencyToken (concurrencyToken As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder
Parameters
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the configuration was applied,
null
otherwise.
Applies to
Entity Framework