EntityFramework-Plus
EntityFramework-Plus copied to clipboard
EF6 Global Query Filter Broken In .NET 6
1. Description
Global Query Filters throw a null reference exception when attempting to add in .NET 6 -- this is due to an internal change on ConditionalWeakTable -- it no longer has a Values property and instead implements IEnumerable<KeyValuePair<TKey, TValue>>
2. Exception
Null Reference Exception when adding a global query filter in .NET 6
https://github.com/zzzprojects/EntityFramework-Plus/blob/32f83427c723ba75cf615cc708df21bcab5802d5/src/shared/Z.EF.Plus.QueryFilterInterceptor.Shared/QueryFilterInterceptorManager.cs
The ClearAllCache method needs to detect if the CacheWeakFilterContext is an IEnumerable before trying to dynamically access the property.
Hello @cmeyertons ,
Thank for letting us know. We will look at it and how to fix it since this probably impacts more than one of our project.
Best Regards,
Jon
Hello @cmeyertons ,
The v6.13.17 has been released.
We do not longer use reflection starting from this version but instead use the ToList
which is now available.
Let me know if everything is now working correctly.
Is this library useful to you? Please help us by becoming a sponsor to keep it alive and supported.
Awesome news, thank you for the quick fix / turnaround!