Case__2_1 - waf/Rx.NET GitHub Wiki

EnumerableEx.Case<TValue, TResult> Method (Func<TValue>, IDictionary<TValue, IEnumerable<TResult>>, IEnumerable<TResult>)

Returns a sequence from a dictionary based on the result of evaluating a selector function, also specifying a default sequence.

Namespace: System.Linq
Assembly: System.Interactive (in System.Interactive.dll)

Syntax

public static IEnumerable<TResult> Case<TValue, TResult>(
	Func<TValue> selector,
	IDictionary<TValue, IEnumerable<TResult>> sources,
	IEnumerable<TResult> defaultSource
)

Parameters

selector

Type: System.Func<TValue>
Selector function used to pick a sequence from the given sources.

sources

Type: System.Collections.Generic.IDictionary<TValue, IEnumerable<TResult>>
Dictionary mapping selector values onto resulting sequences.

defaultSource

Type: System.Collections.Generic.IEnumerable<TResult>
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: IEnumerable<TResult>
The source sequence corresponding with the evaluated selector value; otherwise, the default source.

See Also

Reference

EnumerableEx Class
System.Linq Namespace

⚠️ **GitHub.com Fallback** ⚠️