EnumerableExIfTResult Method (FuncBoolean, IEnumerableTResult, IEnumerableTResult) |
Returns an enumerable sequence based on the evaluation result of the given condition.
Namespace: System.LinqAssembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntaxpublic static IEnumerable<TResult> If<TResult>(
Func<bool> condition,
IEnumerable<TResult> thenSource,
IEnumerable<TResult> elseSource
)
Parameters
- condition
- Type: SystemFuncBoolean
Condition to evaluate. - thenSource
- Type: System.Collections.GenericIEnumerableTResult
Sequence to return in case the condition evaluates true. - elseSource
- Type: System.Collections.GenericIEnumerableTResult
Sequence to return in case the condition evaluates false.
Type Parameters
- TResult
- Result sequence element type.
Return Value
Type:
IEnumerableTResultEither of the two input sequences based on the result of evaluating the condition.
See Also