Skip to content

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

Closed

Description

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)

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions