EnumerableExCaseTValue, TResult Method (FuncTValue, IDictionaryTValue, IEnumerableTResult, IEnumerableTResult) |
Returns a sequence from a dictionary based on the result of evaluating a selector function, also specifying a default sequence.
Namespace: System.LinqAssembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntaxpublic static IEnumerable<TResult> Case<TValue, TResult>(
Func<TValue> selector,
IDictionary<TValue, IEnumerable<TResult>> sources,
IEnumerable<TResult> defaultSource
)
Parameters
- selector
- Type: SystemFuncTValue
Selector function used to pick a sequence from the given sources. - sources
- Type: System.Collections.GenericIDictionaryTValue, IEnumerableTResult
Dictionary mapping selector values onto resulting sequences. - defaultSource
- Type: System.Collections.GenericIEnumerableTResult
Default sequence to return in case there's no corresponding source for the computed selector value.
Type Parameters
- TValue
- Type of the selector value.
- TResult
- Result sequence element type.
Return Value
Type:
IEnumerableTResultThe source sequence corresponding with the evaluated selector value; otherwise, the default source.
See Also