Range Method

Task Parallel System.Threading

Generates a parallel sequence of integral numbers within a specified range.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function Range ( _
	start As Integer, _
	count As Integer _
) As ParallelQuery(Of Integer)
C#
public static ParallelQuery<int> Range(
	int start,
	int count
)

Parameters

start
Type: System..::.Int32
The value of the first integer in the sequence.
count
Type: System..::.Int32
The number of sequential integers to generate.

Return Value

An IEnumerable<Int32> in C# or IEnumerable(Of Int32) in Visual Basic that contains a range of sequential integral numbers.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeException count is less than 0 -or- start + count - 1 is larger than MaxValue()()().

See Also