linq2db / linq2db.EntityFrameworkCore

Bring power of Linq To DB to Entity Framework Core projects
MIT License
462 stars 38 forks source link

[net5.0] Using OrderBy followed by ThenBy inside RowNumber results in swapped columns for sorting #83

Closed lokalmatador closed 3 years ago

lokalmatador commented 3 years ago

Using both OrderByand ThenBy inside RowNumber in a Linq2Db query results in an erroneous raw SQL query where the columns used in OrderBy and ThenBy are swapped, i.e.,...Sql.Ext.RowNumber().Over().OrderBy(A).ThenBy(B)... results in the following erroneous query string like ...ROW_NUMBER() OVER(ORDER BY B, A)....

Here's an MWE with two test cases demonstrating the issue: Linq2DbMWE.zip

It was working before updating to net5.0.

sdanyliv commented 3 years ago

@lokalmatador, sorry about that. We already fixed this regression but not released yet. But you can connect to Azure Pipelines Nuget feed and get latest linq2db version

https://dev.azure.com/linq2db/linq2db/_packaging?_a=feed&feed=linq2db

sdanyliv commented 3 years ago

https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-nuget?view=azure-devops#windows-add-the-feed-to-your-nuget-configuration