-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
net5.0 OrderBy problem #468
Comments
Hello @totpero, I'll take a look. (Note that I'm also building a EF5 specific NuGet which could maybe solve your issue) I keep you informed. |
Should a normal OrderBy not be like: |
Hi, |
I've uploaded a preview for EF5 (Microsoft.EntityFrameworkCore.DynamicLinq 5.2.7-preview-03) |
The boilerplate use datatables.net and the order is made by the number of the column. If the translated into order by 3 DESC insted of that will solve the problem order by (SELECT 3) DESC |
As far I can see, this code var orderBy3 = context.Cars.OrderBy("3 DESC").ToList(); Does compile, however no order by is executed because the generated SQL does not have an order by generated: SELECT [c].[Key], [c].[Brand], [c].[Color], [c].[DateDeleted], [c].[DateLastModified], [c].[Extra], [c].[NullableInt], [c].[Vin], [c].[Year]
FROM [Cars] AS [c] When using SELECT [c].[Key], [c].[Brand], [c].[Color], [c].[DateDeleted], [c].[DateLastModified], [c].[Extra], [c].[NullableInt], [c].[Vin], [c].[Year]
FROM [Cars] AS [c]
ORDER BY [c].[Year] DESC |
Yes, you have right, the |
OK. Closing this issue. @njsent If you still have questions, raise a new issue regarding this. |
Unfortunately the new version did not fix the problem but I was able to solve the problem by SELECTing the last & first columns. These two columns were only used for dynamic OrderBy previously so I'm not sure if it's even related to .net core 5.0 or if I just have to always SELECT the columns that are used for dynamic OrderBy. I really appreciate you putting the 5.0 lib up so quickly anyway. |
Hi,
I'm using aspboilerplate that use this nuget.
After update entityframework to version 5 and net5.0 this not longer work
When i run sqlprofiler on my query i saw that is translated into:
order by (SELECT 3)
and this is not ok;Because this two query are not equals on result:
Select top 10 * from [pay].[table] order by 3 DESC
Select top 10 * from [pay].[table] order by (SELECT 3) DESC
The text was updated successfully, but these errors were encountered: