Configuring non-timestamp tokens through data annotation

The data annotation configuration is straightforward; we have already seen the annotation in the Introducing concurrency tokens section of this chapter and it is not something new to us. Let's see how the ConcurrencyCheck attribute is configured:

    public class Post    {      // Code removed for brevity      [ConcurrencyCheck]      public string Url { get; set; }      // Code removed for brevity    }

The preceding configuration will let EF Core consider the Url column as the concurrency check column, and any further update to this column will restrict users from performing parallel updates.

We have already seen the concurrency conflicts while trying to edit posts in different tabs, which is kind of a simulation ...

Get Mastering Entity Framework Core 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.