Skip to content

Queries using (DateTime).Date fail to translate #25

Closed
@fordisonharry

Description

@fordisonharry

Hi,

Thanks a lot for your work on this library.

We are in the process of migrating an existing DbContext where DateTime is still used, and noticed that a specific existing query on an entity that has no NodaTime types fails to translate if the context is configured with NodaTime support, otherwise it translates fine.

It seems the issue is related to the use of DateTime's Date property in the LINQ expression.

Here is a simple repro: https://github.com/fordisonharry/EFCore.SqlServer.NodaTime/commit/849667bf4a388cad6f6a34c80138245b4d53ac43

It repros on the .net 6 branch as well.

I will have some more time next weekend to look into it, if it's not immediately obvious to you what the issue is.

Thanks again for the library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions