-
Notifications
You must be signed in to change notification settings - Fork 457
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
Query generation issues when using ODATA #2092
Comments
Thanks for the cases! It will be definitely easy to fix them all in one batch. Off-top: |
EF Core 3.1 fails to execute the aggregates at all. Using EF Core 2.2 it can't generate SQL but it silently loads the whole table and processes the aggregation in memory. |
I see, one team creates something not compatible with others. But I saw in OData code hacks for each EF version. Workarounds can not help if there are no test cases on EF side. Anyway OData team are also clever guys, they have defined dynamic aggregation without generating run-time classes on the fly. I was surprised with the idea to just inject into JSON serialization with specially prepared classes. |
Curious about that second part and dynamic aggregation. Can you point me to where you see that in the ODATA code if you have a chance? |
Ok, sorry I have no time to explain in deep. There is expression that was generated when I've tried to reproduce previous issue from your sample: They manipulate with names and projection to get information for serialization later. It is not a real classes from OData library, but copied and simplified for easy reproducing. If you interested in, you can analyze their sources, names are exactly the same. |
Fix for #2092. Improved SelectContext to handle grouping and unexpected conversions.
…ed conversions. (cherry picked from commit faac70b)
@djkunkel, version 2.9.7 will be released on Thursday. Dsitinct.Count queries will work but hey have non optimal SQL generation. If you expect |
Anyway, let me know how it works for you. |
Sorry for delay, but these improvements are working very well for me. Thanks to you and the team! |
Worked through a few more of my ODATA examples, I've discovered a few further issues with query generation when using Microsoft ODATA WebApi (https://github.com/OData/WebApi) for .net core 3.1. I'm using a build from commit 8cd544b for linq2db in the master branch with the fix for #2070
Sample project here:
https://github.com/djkunkel/linq2db-aggregate-odata-sample
The following requests fails to generate SQL:
Without orderby:
With orderby:
The following cases do work for reference:
Thank you for this project again!
The text was updated successfully, but these errors were encountered: