Queryable.Index<TSource>(IQueryable<TSource>) Method

Definition

Return index and the associated item.

C#
public static System.Linq.IQueryable<(int Index, TSource Item)> Index<TSource>(this System.Linq.IQueryable<TSource> source);

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IQueryable<TSource>

An IQueryable<T> to return an element from.

Returns

An enumerable that incorporates each element index into a tuple.

Exceptions

source is null.

Applies to

Product Versions
.NET 9