-
-
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 with non-english letters give different ordering result on string vs key selector #363
Comments
@perason The code examples you provide are 'normal' linq queries. Can you also provide examples for dynamic linq? |
I thought I just did. To enable a If this is not a dynamic linq sample, what is? |
Ah I see, sorry for the confusion, your code is like: .OrderBy("ProductId", StringComparer.Create(culture, true)) However the method will be : https://github.com/StefH/System.Linq.Dynamic.Core/blob/master/src/System.Linq.Dynamic.Core/DynamicQueryableExtensions.cs#L1316 Which means that the StringComparer will be supplied as a normal argument. .OrderBy("{0}", "ProductId") Note that for numbers, there is https://github.com/StefH/System.Linq.Dynamic.Core/blob/master/src/System.Linq.Dynamic.Core/ParsingConfig.cs#L183 Maybe I should add StringComparer or CultureInfo setting so that you choose how it should behave. |
If you could add how to use StringComparer and CultureInfo I would be grateful, and thanks very much for quick response. |
Hello @perason , The v1.1.2 has been released. The OrderBynow supports the Best Regards, Jon Performance Libraries Runtime Evaluation |
The issue I have is that when using a string (
"ProductId"
) for ordering it doesn't sort properly, e.g.but when using a key selector (
s => s.ProductId
) it does, e.g.I am using
System.Linq.Dynamic.Core
ver. 1.0.23.I also tried with
StringComparer.InvariantCulture
, but its result is the same.My
itemList
object(s) looks like this, and is aList<Inventory>
The text was updated successfully, but these errors were encountered: