Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EF6 Global Query Filter Broken In .NET 6 #724

Open
cmeyertons opened this issue Mar 29, 2022 · 3 comments
Open

EF6 Global Query Filter Broken In .NET 6 #724

cmeyertons opened this issue Mar 29, 2022 · 3 comments
Assignees

Comments

@cmeyertons
Copy link

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.

@JonathanMagnan JonathanMagnan self-assigned this Mar 30, 2022
@JonathanMagnan
Copy link
Member

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

@JonathanMagnan
Copy link
Member

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.

@cmeyertons
Copy link
Author

Awesome news, thank you for the quick fix / turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants