Method OrderBy
View SourceOrderBy<T, TKey>(IAsyncEnumerable<T>, Func<T, TKey>, OrderByDirection)
Sorts the elements of a sequence in a particular direction (ascending, descending) according to a key
Declaration
public static IOrderedAsyncEnumerable<T> OrderBy<T, TKey>(this IAsyncEnumerable<T> source, Func<T, TKey> keySelector, OrderByDirection direction)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The sequence to order |
Func<T, TKey> | keySelector | A key selector function |
OrderByDirection | direction | A direction in which to order the elements (ascending, descending) |
Returns
Type | Description |
---|---|
IOrderedAsyncEnumerable<T> | An ordered copy of the source sequence |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the source sequence |
TKey | The type of the key used to order elements |
OrderBy<T, TKey>(IAsyncEnumerable<T>, Func<T, TKey>, IComparer<TKey>, OrderByDirection)
Sorts the elements of a sequence in a particular direction (ascending, descending) according to a key
Declaration
public static IOrderedAsyncEnumerable<T> OrderBy<T, TKey>(this IAsyncEnumerable<T> source, Func<T, TKey> keySelector, IComparer<TKey> comparer, OrderByDirection direction)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T> | source | The sequence to order |
Func<T, TKey> | keySelector | A key selector function |
IComparer<TKey> | comparer | A comparer used to define the semantics of element comparison |
OrderByDirection | direction | A direction in which to order the elements (ascending, descending) |
Returns
Type | Description |
---|---|
IOrderedAsyncEnumerable<T> | An ordered copy of the source sequence |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the source sequence |
TKey | The type of the key used to order elements |