-
Notifications
You must be signed in to change notification settings - Fork 191
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
Performing sum on date subtraction (TimeSpan) not working (.NET 7) #271
Comments
@Karmgahl Can you provide a simple, complete test case and/or a trace? That would help us diagnose the problem more quickly. The ODP.NET EF.Functions support has been requested before, but not from a significant number of customers. Are there particular methods you'd want to prioritize to be supported? |
I think this is the best I can do for now. (Ignore the timestamp ones as I was curious to see if using timestamp/datetimeoffset instead of date would change anything. It did not, same error) Regarding EF.Functions. Id say the datediff functions included in the MS SQL provider that I illustrated in my screenshot for my previous post would've been nice to have. Especially with regard to the current "unable to translate" situation. table in oracle:
Inserts to fill with data
entity:
Actual C# test code (.NET 7 and EF 7 with oracle EF 7 provider):
|
@Karmgahl Thanks for the complete test case. I was able to reproduce your issue. I've filed a bug (34996747) to track the issue. The bug also occurs in the new Oracle EF Core 7.21.9, which was released last night. So, it will have to be fixed in a later release. |
Example:
This will generate a "could not be translated" exception.
I find it strange that simple datetime operations like this is not at all working even in .NET 7. As it's something that is probably quite a common thing to do.
Sure one could always do the operation in .NET after the query has ran. But that is not a very performant solution, if you're fetching a lot of rows.
Also I'm wondering why oracle has chosen to not including ANY of the EF.Functions that Microsoft does for SQL server? If you would've, then this simple datetime handling would've probably worked without issue.
I really think microsoft did a major blunder in not enforcing all providers to provide some default EF.Functions as it makes becoming DB agnostic A LOT more complicated than it needs to be.
The text was updated successfully, but these errors were encountered: