QueryableExGenerateTState, TResult Method (IQueryProvider, TState, ExpressionFuncTState, Boolean, ExpressionFuncTState, TState, ExpressionFuncTState, TResult) |
Generates a sequence by mimicking a for loop.
Namespace: System.LinqAssembly: System.Interactive.Providers (in System.Interactive.Providers.dll) Version: 1.2.0.0
Syntaxpublic static IQueryable<TResult> Generate<TState, TResult>(
this IQueryProvider provider,
TState initialState,
Expression<Func<TState, bool>> condition,
Expression<Func<TState, TState>> iterate,
Expression<Func<TState, TResult>> resultSelector
)
Parameters
- provider
- Type: System.LinqIQueryProvider
Query provider. - initialState
- Type: TState
Initial state of the generator loop. - condition
- Type: System.Linq.ExpressionsExpressionFuncTState, Boolean
Loop condition. - iterate
- Type: System.Linq.ExpressionsExpressionFuncTState, TState
State update function to run after every iteration of the generator loop. - resultSelector
- Type: System.Linq.ExpressionsExpressionFuncTState, TResult
Result selector to compute resulting sequence elements.
Type Parameters
- TState
- State type.
- TResult
- Result sequence element type.
Return Value
Type:
IQueryableTResultSequence obtained by running the generator loop, yielding computed elements.
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