Uh oh!
There was an error while loading. Please reload this page.
[API Implementation]: Add Order and OrderDescending to Enumerable and Queryable - #70525
Conversation
ghost
commented
Jun 9, 2022
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
ghost
commented
Jun 9, 2022
Tagging subscribers to this area: @dotnet/area-system-linq Issue DetailsProposal implementation of #67194 closes #67194) ProposalnamespaceSystem.Linq{publicpartialclassEnumerable{publicstaticIOrderedEnumerable<T>Order<T>(thisIEnumerable<T>source);publicstaticIOrderedEnumerable<T>Order<T>(thisIEnumerable<T>source,IComparer<T>comparer);publicstaticIOrderedEnumerable<T>OrderDescending<T>(thisIEnumerable<T>source);publicstaticIOrderedEnumerable<T>OrderDescending<T>(thisIEnumerable<T>source,IComparer<T>comparer);}publicpartialclassQueryable{// Or whatever's correct.[DynamicDependency("Order`1",typeof(Enumerable))]publicstaticIOrderedQueryable<T>Order<T>(thisIQueryable<T>source);[DynamicDependency("Order`1",typeof(Enumerable))]publicstaticIOrderedQueryable<T>Order<T>(thisIQueryable<T>source,IComparer<T>comparer);[DynamicDependency("OrderDescending`1",typeof(Enumerable))]publicstaticIOrderedQueryable<T>OrderDescending<T>(thisIQueryable<T>source);[DynamicDependency("OrderDescending`1",typeof(Enumerable))]publicstaticIOrderedQueryable<T>OrderDescending<T>(thisIQueryable<T>source,IComparer<T>comparer);}}Current state of implementation
Footnotes
|
rhuijben
commented
Jun 10, 2022
I don't think there is no way queryable can implement this new API in a more performant way than enumerable now does, as there is no documented way to introspect the comparer and somehow handle that on a repository layer. In that case: is it useful to add the helper on |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Eirik Tsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
deeprobin
commented
Jun 30, 2022
|
Uh oh!
There was an error while loading. Please reload this page.
eiriktsarpalis
commented
Jun 30, 2022
Ugh. I copied and pasted the code from main but it looks like fat arrow formatting was different. Should be fixed now. |
deeprobin
commented
Jun 30, 2022
@eiriktsarpalis Thank you. I think this is ready-to-merge. Or do you have concerns (then we could ask a 2nd reviewer)? |
deeprobin
commented
Jun 30, 2022
I think this API might not be bad for the announcements in the next preview version. Many people work with LINQ so this is probably a relatively interesting API. |
eiriktsarpalis
commented
Jun 30, 2022
@deeprobin Would you like to add a short announcement in the Preview 7 issue? |
deeprobin
commented
Jun 30, 2022
@eiriktsarpalisdotnet/core#7455 (comment) suggestions? |
eiriktsarpalis
commented
Jun 30, 2022
Looks good overall, I would skip the API shape and just focus on the final code sample. It should be enough to communicate the background and motivation. |
deeprobin
commented
Jun 30, 2022
I removed the api shape 👍🏼 |
eiriktsarpalis
commented
Jun 30, 2022
Thanks @deeprobin ! |
Proposal implementation of #67194 (closes#67194)
Proposal
Current state of implementation
/cc @terrajobst
Footnotes
I have implemented only the most important test cases, as I would imagine that the complex cases are flaky.
If desired, I can also implement more test cases. ↩
Copied from the Microsoft Docs from the OrderBy overloads and adjusted accordingly. ↩