Click or drag to resize
EnumerableExWhileTResult Method
Generates an enumerable sequence by repeating a source sequence as long as the given loop condition holds.

Namespace: System.Linq
Assembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntax
C#
public static IEnumerable<TResult> While<TResult>(
	Func<bool> condition,
	IEnumerable<TResult> source
)

Parameters

condition
Type: SystemFuncBoolean
Loop condition.
source
Type: System.Collections.GenericIEnumerableTResult
Sequence to repeat while the condition evaluates true.

Type Parameters

TResult
Result sequence element type.

Return Value

Type: IEnumerableTResult
Sequence generated by repeating the given sequence while the condition evaluates to true.
See Also