RangeOf Method
Definition
RangeOf<T>(int, Func<int, T>)
Generates a sequence of T within a specified range.
public static IEnumerable<T> RangeOf<T>(int count, Func<int, T> generator)
Parameters
countintThe number of
Tto generate.generatorFunc<int, T>The function delegate that will resolve the instance of
T; the parameter passed to the delegate represents the index (zero-based) of the element to return.
Returns
- IEnumerable<T>
An IEnumerable<T> that contains a range of
Telements.
Type Parameters
TThe type of the elements to return.
Exceptions
- ArgumentNullException
generatorisnull.- ArgumentOutOfRangeException
countis less than 0.