Efcore: Add option to ignore concurrency checking for some entities

Created on 25 Nov 2019  路  3Comments  路  Source: dotnet/efcore

On our application we added optimistic concurrency using the [ConcurrencyCheck] annotation on our model classes. It is working fine, but there are some very specific cases where we would like to force an update without doing concurrency checking (yes, we know the risks).

We would like a built-in solution on EF Core DbContext that ignores concurrency checking for some entities when calling SaveChanges. Something like:

_context.IgnoreConcurrencyChecking(entity);
_context.SaveChanges();
//No DbConcurrencyException just a forced updated

Thanks.

customer-reported type-enhancement

Most helpful comment

#10443 is at the model level, while this one is at the SaveChanges level. It makes sense to track them separately.

Added to the epic.

All 3 comments

Note for triage: very similar to #10443

#10443 is at the model level, while this one is at the SaveChanges level. It makes sense to track them separately.

Added to the epic.

Thanks for having the time to take a look into it guys.

Was this page helpful?
0 / 5 - 0 ratings