The 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.

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.

Last updated: 27/02/2018 13:23:17

© 2018 - Learn Entity Framework Core.
All rights reserved.