Method MaxItems
MaxItems<T>(IAsyncEnumerable<T>)
Returns all of the items that share the maximum value of a sequence.
Declaration
public static IAsyncEnumerable<T> MaxItems<T>(this IAsyncEnumerable<T> source)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<T> | source | The source sequence. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the sequence. |
Remarks
This operator is a shortcut for DensePartialSort<T>(IAsyncEnumerable<T>, int, OrderByDirection) with a
direction of Descending and a count of 1.
This operator uses deferred execution and streams it results.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
MaxItems<T>(IAsyncEnumerable<T>, IComparer<T>?)
Returns all of the items that share the maximum value of a sequence.
Declaration
public static IAsyncEnumerable<T> MaxItems<T>(this IAsyncEnumerable<T> source, IComparer<T>? comparer)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncEnumerable<T> | source | The source sequence. |
| IComparer<T> | comparer | A IComparer<T> to compare elements. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<T> |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the sequence. |
Remarks
This operator is a shortcut for DensePartialSort<T>(IAsyncEnumerable<T>, int, IComparer<T>?, OrderByDirection) with a
count of 1.
This operator uses deferred execution and streams it results.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|