Method Index
View SourceIndex<TSource>(IAsyncEnumerable<TSource>)
Returns a sequence of tuples where the key
is
the zero-based index of the value
in the source
sequence.
Declaration
public static IAsyncEnumerable<(int index, TSource item)> Index<TSource>(this IAsyncEnumerable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(int index, TSource item)> | A sequence of tuples. |
Type Parameters
Name | Description |
---|---|
TSource | Type of elements in |
Remarks
This operator uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Index<TSource>(IAsyncEnumerable<TSource>, int)
Returns a sequence of tuples where the key
is
the zero-based index of the value
in the source
sequence. An additional parameter specifies the
starting index.
Declaration
public static IAsyncEnumerable<(int index, TSource item)> Index<TSource>(this IAsyncEnumerable<TSource> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
int | startIndex |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(int index, TSource item)> | A sequence of tuples. |
Type Parameters
Name | Description |
---|---|
TSource | Type of elements in |
Remarks
This operator uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|