Method RightOuterMergeJoin
RightOuterMergeJoin<TLeft, TRight, TKey>(IAsyncEnumerable<TLeft>, IAsyncEnumerable<TRight>, Func<TLeft, TKey>, Func<TRight, TKey>, IComparer<TKey>?)
Performs a right outer join on two heterogeneous sequences.
Declaration
public static IAsyncEnumerable<(TLeft? Left, TRight Right)> RightOuterMergeJoin<TLeft, TRight, TKey>(this IAsyncEnumerable<TLeft> left, IAsyncEnumerable<TRight> right, Func<TLeft, TKey> leftKeySelector, Func<TRight, TKey> rightKeySelector, IComparer<TKey>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TLeft> | left | The first sequence. |
| IAsyncEnumerable<TRight> | right | The second sequence. |
| Func<TLeft, TKey> | leftKeySelector | A function to extract the join key from each element of the first sequence. |
| Func<TRight, TKey> | rightKeySelector | A function to extract the join key from each element of the second sequence. |
| IComparer<TKey> | comparer | An IEqualityComparer<T> to hash and compare keys. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<(TLeft Left, TRight Right)> | A sequence containing values from a right outer join of the two input sequences. |
Type Parameters
| Name | Description |
|---|---|
| TLeft | The type of elements in the first sequence. |
| TRight | The type of elements in the second sequence. |
| TKey | The type of the key returned by the key selector functions. |
Remarks
The result of this method is a `right outer`-join. All elements from right are returned,
along with any matching elements from left, if any are present. If no values in left match, default is returned for the left element.
This method is implemented using a `merge`-join. The sequences left and right are assumed to be already sorted. Results from using unsorted sequences with this method are
undefined. Each sequence is enumerated exactly once in a parallel fashion, until both sequences are
fully enumerated.
This method uses deferred execution and streams its results.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
RightOuterMergeJoin<TLeft, TRight, TKey, TResult>(IAsyncEnumerable<TLeft>, IAsyncEnumerable<TRight>, Func<TLeft, TKey>, Func<TRight, TKey>, Func<TRight, TResult>, Func<TLeft, TRight, TResult>, IComparer<TKey>?)
Performs a right outer join on two heterogeneous sequences.
Declaration
public static IAsyncEnumerable<TResult> RightOuterMergeJoin<TLeft, TRight, TKey, TResult>(this IAsyncEnumerable<TLeft> left, IAsyncEnumerable<TRight> right, Func<TLeft, TKey> leftKeySelector, Func<TRight, TKey> rightKeySelector, Func<TRight, TResult> rightResultSelector, Func<TLeft, TRight, TResult> bothResultSelector, IComparer<TKey>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TLeft> | left | The first sequence. |
| IAsyncEnumerable<TRight> | right | The second sequence. |
| Func<TLeft, TKey> | leftKeySelector | A function to extract the join key from each element of the first sequence. |
| Func<TRight, TKey> | rightKeySelector | A function to extract the join key from each element of the second sequence. |
| Func<TRight, TResult> | rightResultSelector | A function to create a result element from a |
| Func<TLeft, TRight, TResult> | bothResultSelector | A function to create a result element from two matching elements. |
| IComparer<TKey> | comparer | An IEqualityComparer<T> to hash and compare keys. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TResult> | A sequence containing values projected from a right outer join of the two input sequences. |
Type Parameters
| Name | Description |
|---|---|
| TLeft | The type of elements in the first sequence. |
| TRight | The type of elements in the second sequence. |
| TKey | The type of the key returned by the key selector functions. |
| TResult | The type of the result elements. |
Remarks
The result of this method is a `left outer`-join. Values are projected using bothResultSelector when matching elements are found in both left and right sequences. Values are projected using rightResultSelector when elements in
right do not have a matching element in left.
This method is implemented using a `merge`-join. The sequences left and right are assumed to be already sorted. Results from using unsorted sequences with this method are
undefined. Each sequence is enumerated exactly once in a parallel fashion, until both sequences are
fully enumerated.
This method uses deferred execution and streams its results.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|