Method DenseRank
View SourceDenseRank<TSource>(IAsyncEnumerable<TSource>)
Ranks each item in the sequence in ascending order using a default comparer, with no gaps in the ranking values. The rank starts at one and keeps incrementing by one for each different item.
Declaration
public static IAsyncEnumerable<(TSource item, int rank)> DenseRank<TSource>(this IAsyncEnumerable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The sequence whose items will be ranked |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(TSource item, int rank)> | A sorted sequence of items and their rank. |
Type Parameters
Name | Description |
---|---|
TSource | Type of item in the sequence |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DenseRank<TSource>(IAsyncEnumerable<TSource>, OrderByDirection)
Ranks each item in the sequence in the order defined by sortDirection
using a default comparer, with no gaps in the ranking values. The rank starts at one
and keeps incrementing by one for each different item.
Declaration
public static IAsyncEnumerable<(TSource item, int rank)> DenseRank<TSource>(this IAsyncEnumerable<TSource> source, OrderByDirection sortDirection)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The sequence whose items will be ranked |
OrderByDirection | sortDirection | Defines the ordering direction for the sequence |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(TSource item, int rank)> | A sorted sequence of items and their rank. |
Type Parameters
Name | Description |
---|---|
TSource | Type of item in the sequence |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DenseRank<TSource>(IAsyncEnumerable<TSource>, IComparer<TSource>)
Ranks each item in the sequence in ascending order using a caller-supplied comparer, with no gaps in the ranking values. The rank starts at one and keeps incrementing by one for each different item.
Declaration
public static IAsyncEnumerable<(TSource item, int rank)> DenseRank<TSource>(this IAsyncEnumerable<TSource> source, IComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The sequence of items to rank |
IComparer<TSource> | comparer | A object that defines comparison semantics for the elements in the sequence |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(TSource item, int rank)> | A sorted sequence of items and their rank. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DenseRank<TSource>(IAsyncEnumerable<TSource>, IComparer<TSource>, OrderByDirection)
Ranks each item in the sequence in the order defined by sortDirection
using a caller-supplied comparer, with no gaps in the ranking values. The rank starts at one
and keeps incrementing by one for each different item.
Declaration
public static IAsyncEnumerable<(TSource item, int rank)> DenseRank<TSource>(this IAsyncEnumerable<TSource> source, IComparer<TSource> comparer, OrderByDirection sortDirection)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The sequence of items to rank |
IComparer<TSource> | comparer | A object that defines comparison semantics for the elements in the sequence |
OrderByDirection | sortDirection | Defines the ordering direction for the sequence |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(TSource item, int rank)> | A sorted sequence of items and their rank. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|