Skip to content

Handle comparers for nullable value types in primitive collections #35235

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

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

ajcvickers
Copy link
Contributor

Fixes #35117

In general, value comparers for value type should target the non-nullable variant of the type. This is because we automatically handle null values internally. However, in this case, a comparer for a nullable tpe was created, which was then used with a collection of non-nullable types. The fix is to use the nullable list comparer if the underlying comparer is for a nullable value type.

Fixes #35117

In general, value comparers for value type should target the non-nullable variant of the type. This is because we automatically handle null values internally. However, in this case, a comparer for a nullable tpe was created, which was then used with a collection of non-nullable types. The fix is to use the nullable list comparer if the underlying comparer is for a nullable value type.
@ajcvickers ajcvickers requested a review from a team as a code owner November 28, 2024 17:14
@ajcvickers ajcvickers merged commit 76d5bef into main Nov 30, 2024
7 checks passed
@ajcvickers ajcvickers deleted the Coercion branch November 30, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No coercion operator is defined between nullable and not nullable type after upgrade from EFCore8 to EFCore9
2 participants