-
-
Notifications
You must be signed in to change notification settings - Fork 84
Description
System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
at System.Collections.Generic.HashSet`1.AddIfNotPresent(T value)
at
EntityFramework.DynamicFilters.DynamicFilterExtensions.PreventDisabledFilterConditions(DbModelBuilder modelBuilder, String filterName)
Affected software is a ASP.NET Core 3.1 web API using EFv6.44, a restart stopped the error from recurring. I've been using the package for several years (most of the time with .NET Framework) without this issue, this must be a very rare race condition.
I guess the fix is using ConcurrenctDictionary<> Instead of HashSet<>, like the other variables in DynamicFilterExtensions class.