Method InnerLoopJoin
View SourceInnerLoopJoin<TLeft, TRight, TKey>(IAsyncEnumerable<TLeft>, IAsyncEnumerable<TRight>, Func<TLeft, TKey>, Func<TRight, TKey>, IEqualityComparer<TKey>?)
Performs an inner join on two heterogeneous sequences.
Declaration
public static IAsyncEnumerable<(TLeft Left, TRight Right)> InnerLoopJoin<TLeft, TRight, TKey>(this IAsyncEnumerable<TLeft> left, IAsyncEnumerable<TRight> right, Func<TLeft, TKey> leftKeySelector, Func<TRight, TKey> rightKeySelector, IEqualityComparer<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. |
IEqualityComparer<TKey> | comparer | An IEqualityComparer<T> to hash and compare keys. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(TLeft Left, TRight Right)> | A sequence containing values from an inner 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 an `inner`-join. Values are only returned if matching elements are found in
both left
and right
sequences.
This method is implemented using a `loop`-join. The sequence right
is cached, and
for-each element of left
, the cached sequence is enumerated for matching elements.
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InnerLoopJoin<TLeft, TRight, TKey, TResult>(IAsyncEnumerable<TLeft>, IAsyncEnumerable<TRight>, Func<TLeft, TKey>, Func<TRight, TKey>, Func<TLeft, TRight, TResult>, IEqualityComparer<TKey>?)
Performs an inner join on two heterogeneous sequences.
Declaration
public static IAsyncEnumerable<TResult> InnerLoopJoin<TLeft, TRight, TKey, TResult>(this IAsyncEnumerable<TLeft> left, IAsyncEnumerable<TRight> right, Func<TLeft, TKey> leftKeySelector, Func<TRight, TKey> rightKeySelector, Func<TLeft, TRight, TResult> bothResultSelector, IEqualityComparer<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<TLeft, TRight, TResult> | bothResultSelector | A function to create a result element from two matching elements. |
IEqualityComparer<TKey> | comparer | An IEqualityComparer<T> to hash and compare keys. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence containing results projected from an inner 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 an `inner`-join. Values are projected using bothResultSelector
only if matching elements are found in both left
and
right
sequences.
This method is implemented using a `loop`-join. The sequence right
is cached, and
for-each element of left
, the cached sequence is enumerated for matching elements.
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|