EF Core ConcurrencyCheck Attribute

The ConcurrencyCheck attribute is used to specify that a property should be included in a WHERE clause in an UPDATE or DELETE statement as part of concurrency management.

language-csharp
|
public class Author
{
    public int AuthorId { get; set; }
    [ConcurrencyCheck]
    public string FirstName { get; set; }
    [ConcurrencyCheck]
    public string LastName { get; set; }
    public string Biography { get; set; }
    public ICollection<Book> Books { get; set; }
}

Fluent API

The Fluent API equivalent to the ConcurrencyCheck attribute is the IsConcurrencyToken method.


Date Modified: 2023-02-28
Author:

Edit this page in GitHub

Got any EF Core Question?