-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Implement Enumerable.*By methods (DistinctBy, ExceptBy, IntersectBy, UnionBy, MinBy, MaxBy) #50335
Conversation
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. |
Tagging subscribers to this area: @eiriktsarpalis Issue DetailsFix #27687. Note that the implementation does not include the following overloads: public static IEnumerable<TSource> ExceptBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector);
public static IEnumerable<TSource> ExceptBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer);
public static IEnumerable<TSource> IntersectBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector);
public static IEnumerable<TSource> IntersectBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer); I have decided to remove them since they were causing type inference issues and can be expressed trivially in terms of the other
|
Co-authored-by: Stephen Toub <stoub@microsoft.com>
The new linq api introduces MaxBy() and MinBy() dotnet/runtime#50335 which are different from morelinq's impl which I was referencing. To avoid conflicts, rename the my methods. maxima_by() sounds like a more appropriate name.. Also except_by() according to the link is interesting...
Fix #27687.
Note that the implementation does not include the following overloads:
I have decided to remove them since they were causing type inference issues and can be expressed trivially in terms of the other
ExceptBy
andIntersectBy
overloads.