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

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

Closed
fordisonharry opened this issue Nov 7, 2021 · 5 comments
Closed

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

fordisonharry opened this issue Nov 7, 2021 · 5 comments

Comments

@fordisonharry
Copy link

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.

@StevenRasmussen
Copy link
Owner

This is fixed in the 6.0.0 release.

@fordisonharry
Copy link
Author

Wonderful, thank you!

@fordisonharry
Copy link
Author

@StevenRasmussen
Would it be possible to bring that change into a new 5.x release? It would be useful for us (and I assume others) to have that in a version that still targets netstandard, as we may not be able to move everything to 6.0 for a while. Can PR if you wish. Thank you.

StevenRasmussen added a commit that referenced this issue Nov 9, 2021
StevenRasmussen added a commit that referenced this issue Nov 9, 2021
@StevenRasmussen
Copy link
Owner

I just published v5.0.3 and v3.1.2 that contains the fix.

@fordisonharry
Copy link
Author

Thank you : )

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

No branches or pull requests

2 participants