Method ExceptBy
ExceptBy<TSource, TKey>(IAsyncEnumerable<TSource>, IAsyncEnumerable<TSource>, Func<TSource, TKey>)
Returns the set of elements in the first sequence which aren't in the second sequence, according to a given key selector.
Declaration
public static IAsyncEnumerable<TSource> ExceptBy<TSource, TKey>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, Func<TSource, TKey> keySelector)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TSource> | first | The sequence of potentially included elements. |
| IAsyncEnumerable<TSource> | second | The sequence of elements whose keys may prevent elements in
|
| Func<TSource, TKey> | keySelector | The mapping from source element to key. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TSource> | A sequence of elements from |
Type Parameters
| Name | Description |
|---|---|
| TSource | The type of the elements in the input sequences. |
| TKey | The type of the key returned by |
Remarks
This is a set operation; if multiple elements in first have
equal keys, only the first such element is returned.
This operator uses deferred execution and streams the results, although
a set of keys from second is immediately selected and retained.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentNullException |
|
| ArgumentNullException |
|
ExceptBy<TSource, TKey>(IAsyncEnumerable<TSource>, IAsyncEnumerable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>?)
Returns the set of elements in the first sequence which aren't in the second sequence, according to a given key selector.
Declaration
public static IAsyncEnumerable<TSource> ExceptBy<TSource, TKey>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TSource> | first | The sequence of potentially included elements. |
| IAsyncEnumerable<TSource> | second | The sequence of elements whose keys may prevent elements in
|
| Func<TSource, TKey> | keySelector | The mapping from source element to key. |
| IEqualityComparer<TKey> | keyComparer | The equality comparer to use to determine whether or not keys are equal.
If null, the default equality comparer for |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TSource> | A sequence of elements from |
Type Parameters
| Name | Description |
|---|---|
| TSource | The type of the elements in the input sequences. |
| TKey | The type of the key returned by |
Remarks
This is a set operation; if multiple elements in first have
equal keys, only the first such element is returned.
This operator uses deferred execution and streams the results, although
a set of keys from second is immediately selected and retained.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentNullException |
|
| ArgumentNullException |
|
| ArgumentNullException |
|