Table of Contents

RangeOf Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Generate.cs

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

count int

The number of T to generate.

generator Func<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 T elements.

Type Parameters

T

The type of the elements to return.

Exceptions

ArgumentNullException

generator is null.

ArgumentOutOfRangeException

count is less than 0.