diff --git a/src/EfOrderBy/RequiredOrder.cs b/src/EfOrderBy/RequiredOrder.cs index f0b0f1a..1866265 100644 --- a/src/EfOrderBy/RequiredOrder.cs +++ b/src/EfOrderBy/RequiredOrder.cs @@ -1,18 +1,18 @@ static class RequiredOrder { - static ConcurrentBag validated = []; + static ConcurrentDictionary validated = []; public static void Validate(DbContext context) { var contextType = context.GetType(); // Only check and validate once per DbContext type - if (validated.Contains(contextType)) + if (validated.ContainsKey(contextType)) { return; } - validated.Add(contextType); + validated.TryAdd(contextType, true); // Check if this DbContext requires ordering for all entities (opt-in feature) var requireOrdering = context.GetService()