-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed as duplicate of#120596
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Collectionsbacklog-cleanup-candidateAn inactive issue that has been marked for automated closure.An inactive issue that has been marked for automated closure.
Description
Similar to the Zip proposed in #20167 it would be useful to have a Join overload that returns a valueTuple.
A very simple implementation (but one that isn't good enough) would be:
public static IEnumerable<(T1, T2)> Join<T1, T2, TKey>(
this IEnumerable<T1> left,
IEnumerable<T2> right,
Func<T1, TKey> leftKey,
Func<T2, TKey> rightKey)
=> left.Join(right, leftKey, rightKey, ValueTuple.Create);It could then be used like this:
foreach(var (a, b) in listA.Join(listB, a => a.Id, b => b.Id))
{
// ...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Collectionsbacklog-cleanup-candidateAn inactive issue that has been marked for automated closure.An inactive issue that has been marked for automated closure.