-
-
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
OrderBy Chaining #62
Comments
Interesting ! I'll take a look. |
This SO post explains why this occurs. I was able to modify code from a blog post to create a ThenBy extension to test. I confirmed that when there is an existing sort order, you have to call ThenBy() for additional ordering. Would it be possible to include a dynamic ThenBy() extension method in your library? |
Should be solved. Please upgrade to latest NuGet packages. |
Thank you, confirmed working. |
I have some unexpected behavior (to me) regarding the OrderBy extension.
I have an existing IQueryable instance and add an order:
qry.AsExpandable().OrderBy(a => a.Inactive);
Then later on I call following statement using the extension method:
qry = qry.AsExpandable().OrderBy("Name asc");
The resulting SQL is
ORDER BY Name, Inactive
which seems counterintuitive, I would've expected the fields to be reversed, i.e. Inactive, Name.Is that expected behavior? With standard LINQ to chain ordering you use OrderBy followed by ThenBy, but I don't see a ThenBy extension method in your library.
EDIT: I'm wondering if something like below is possible, either externally or internal to the library:
The text was updated successfully, but these errors were encountered: