Mid EF Core

How is concurrency handled?

What is optimistic concurrency vs

pessimistic concurrency?

  • Optimistic concurrency: Assumes that conflicts are rare. EF checks for changes

before saving using concurrency tokens.

  • Pessimistic concurrency: Locks records in the DB to prevent other updates (not

supported out-of-the-box in EF Core).

EF Core supports optimistic concurrency using [ConcurrencyCheck] or

[Timestamp].

More from Entity Framework Core Tutorial

All questions for this course