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

Non-nullable value comparer can't be applied on nullable type #26429

Closed
AndriySvyryd opened this issue Oct 21, 2021 · 1 comment
Closed

Non-nullable value comparer can't be applied on nullable type #26429

AndriySvyryd opened this issue Oct 21, 2021 · 1 comment
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported Servicing-approved type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

sadly the above solution does not work anymore with RC2 for Nullable DateOnlys/TimeOnlys

protected sealed override void ConfigureConventions(ModelConfigurationBuilder builder)
        {
            builder.Properties<DateOnly>()
                .HaveConversion<DateOnlyConverter, DateOnlyComparer>()
                .HaveColumnType("date");

            builder.Properties<DateOnly?>()
                .HaveConversion<NullableDateOnlyConverter, NullableDateOnlyComparer>()
                .HaveColumnType("date");
        }

I get the error message, that the "DateOnlyComparer" cannot be used for a nullable DateOnly property. It seems that the Nullable DateOnly conversion is completely ignored.

Because of that, I reverted my whole solution back to RC1.

Are there any changes known regarding this and how to solve that?

Originally posted by @CleanCodeX in #24507 (comment)

@ajcvickers
Copy link
Member

FYI for those impacted by this issue: EF Core 6.0.1 is now available from NuGet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported Servicing-approved type-bug
Projects
None yet
Development

No branches or pull requests

2 participants