-
-
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
"Failed to compare two elements in the array." System.InvalidOperationException (V1.2.19 compared to V1.2.18) #617
Comments
Can you try to extend Like is done here: |
Note that in the version |
Thanks for the very quick reply. 100% converting to IComparer without the <> gets rid of the crash / exception. However; and I really don't get this - the sort doesn't work! If I do the method call without providing a comparer: results.Data = d.OrderBy(orderQueryBuilder.ToString()).ToList(); That works [but it's alphabetic not alphanumeric] If I do: results.Data = d.OrderBy(orderQueryBuilder.ToString(), new AlphanumComparer()).ToList(); It runs the comparer (can breakpoint that) but it's always receiving large integers to sort: Dunno where they come from! If I use the sort routine from elsewhere (i.e. not dynamic LINQ) it works; receives strings and does what it should. Sorry! Not sure what I'm not doing that I should do... The simple mod I made to the sort code was:
... the sort code (tried to model this after your test code and the Microsoft help...) Ta, Dr. Michael Dye |
@michaeldye79 |
Hi - is this any good? |
Yes. I think I did find the bug, now I need to solve it... |
I think I solved it, see this PR: #619 Can you download this branch and test it? Or do you need a MyGet preview version to test? |
Wow thanks... Not done branch download before but will try first thing in the morning (GMT+1) and let you know. Ta. |
A preview can be downloaded from MyGet: See this link on how to use MyGet: |
Morning! Yes - definitely fixed - the sort works fine. Brill; thanks. As we're still developing I'll use this patch if that's ok until the next "proper" release happens? Ta, Michael. |
@michaeldye79 For now you can indeed use this preview version, an official version will be released in some days... |
Hello all,
We've come across a [new] exception being thrown having upgraded V1.2.18 >> V1.2.19:
As in; it works without a hiccup in V1.2.18; but throws the above in V1.2.19.
The code in question is:
where our alpha numeric comparator is defined as:
Not sure what we're doing wrong; the order by query can indeed be for string items, date/time, numeric etc. But thought this was the correct approach to provide a comparator that'd sort out alphanumeric strings.
Any help appreciated - ta, Dr Michael Dye.
The text was updated successfully, but these errors were encountered: