-
Notifications
You must be signed in to change notification settings - Fork 228
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
Using FrozenSet.Contains and enums throws ArgumentNullException: Value cannot be null (Parameter 'constructor') #3385
Comments
Closing as a duplicate of dotnet/efcore#35102 on the EF side. |
@roji This seems to be different issue. Using |
OK, thanks for checking! Will look on my side. |
@roji I'm sorry, I should've probably notified you before I took the initiative to go on a hunt. I spent some time to fiddle around and at least when running the repro with my PR, it's no longer an issue. |
Hey, I was upgrading to .NET 9 and as part of that went from
Npgsql.EntityFrameworkCore.PostgreSQL
8.0.10 to 9.0.1, andMicrosoft.EntityFrameworkCore
8.0.10 to 9.0.0. I found that some previously-working code that usedFrozenSet.Contains
in aWhere
call no longer worked, and now throws anArgumentNullException
which appears to be inside Npgsql. (The stack trace is the only reason I'm opening an issue here and not in dotnet/efcore, let me know if I'm wrong!)Here's a minimal repro:
On version 9.0.2-ci.20241120T194418 this throws the following exception for me:
(ignore the project name, this initially presented similar to a different issue I found and I based the minimal reproduction off of the one I found there)
Notably, if I change the
FrozenSet<TagValue>
to be aList<TagValue>
, it works. I can also insert a call toAsEnumerable
before theContains
, which also fixes the issue. It also appears to be specific to enums, if I make the tags astring
then it works withFrozenSet<string>
The text was updated successfully, but these errors were encountered: