Click or drag to resize
QueryableExWhileTResult Method (IQueryProvider, ExpressionFuncBoolean, IEnumerableTResult)
Generates an enumerable sequence by repeating a source sequence as long as the given loop condition holds.

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

Parameters

provider
Type: System.LinqIQueryProvider
Query provider.
condition
Type: System.Linq.ExpressionsExpressionFuncBoolean
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: IQueryableTResult
Sequence generated by repeating the given sequence while the condition evaluates to true.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also