Method MinItemsBy
MinItemsBy<TSource, TKey>(IAsyncEnumerable<TSource>, Func<TSource, TKey>)
Returns all of the items that share the minimum value of a sequence.
Declaration
public static IAsyncEnumerable<TSource> MinItemsBy<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TSource> | source | The source sequence. |
| Func<TSource, TKey> | keySelector | A function to extract a key from an element. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TSource> |
Type Parameters
| Name | Description |
|---|---|
| TSource | Type of elements in the sequence. |
| TKey | Type of keys. |
Remarks
This operator is a shortcut for DensePartialSortBy<TSource, TKey>(IAsyncEnumerable<TSource>, int, Func<TSource, TKey>, OrderByDirection) with a direction of Ascending
and a count of 1.
This operator uses deferred execution and streams it results.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
MinItemsBy<TSource, TKey>(IAsyncEnumerable<TSource>, Func<TSource, TKey>, IComparer<TKey>?)
Returns all of the items that share the minimum value of a sequence.
Declaration
public static IAsyncEnumerable<TSource> MinItemsBy<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<TSource> | source | The source sequence. |
| Func<TSource, TKey> | keySelector | A function to extract a key from an element. |
| IComparer<TKey> | comparer | A IComparer<T> to compare keys. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TSource> |
Type Parameters
| Name | Description |
|---|---|
| TSource | Type of elements in the sequence. |
| TKey | Type of keys. |
Remarks
This operator is a shortcut for DensePartialSortBy<TSource, TKey>(IAsyncEnumerable<TSource>, int, Func<TSource, TKey>, IComparer<TKey>?, OrderByDirection) with a direction of Ascending and a count of 1.
This operator uses deferred execution and streams it results.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|