Class IEnumerableExtensions
- Namespace
- Payetools.Common.Extensions
- Assembly
- Payetools.Common.dll
Extension methods for instances of IEnumerable<T>.
public static class IEnumerableExtensions
- Inheritance
-
IEnumerableExtensions
- Inherited Members
Methods
WithIndex<T>(IEnumerable<T>)
Provides a new IEnumerable of tuples, where the first element of the tuple is the original item and the second element is the numeric index of the item, zero-based.
public static IEnumerable<(T Value, int Index)> WithIndex<T>(this IEnumerable<T> source)
Parameters
source
IEnumerable<T>Source IEnumerable.
Returns
- IEnumerable<(T Value, int Index)>
New IEnumerable of tuples as described above.
Type Parameters
T
Type of item in original IEnumerable.