Skip to content

},System.Collections.Generic.IDictionary{--0,System.IObservable{--1}})} },System.Collections.Generic.IDictionary{--0,System.IObservable{--1}},System.IObservable{--1})} },System.Collections.Generic.IDictionary{--0,System.IObservable{--1}},System.Reactive.Concurrency.IScheduler)}

Qbservable.Case(IQbservableProvider, Expression>, IDictionary>) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<TResult> Case<TValue, TResult>(this IQbservableProvider provider, Expression<Func<TValue>> selector, IDictionary<TValue, IObservable<TResult>> sources) where TValue : notnull
  • 2. public static IQbservable<TResult> Case<TValue, TResult>(this IQbservableProvider provider, Expression<Func<TValue>> selector, IDictionary<TValue, IObservable<TResult>> sources, IObservable<TResult> defaultSource) where TValue : notnull
  • 3. public static IQbservable<TResult> Case<TValue, TResult>(this IQbservableProvider provider, Expression<Func<TValue>> selector, IDictionary<TValue, IObservable<TResult>> sources, IScheduler scheduler) where TValue : notnull

1. Overload

public static IQbservable<TResult> Case<TValue, TResult>(this IQbservableProvider provider, Expression<Func<TValue>> selector, IDictionary<TValue, IObservable<TResult>> sources) where TValue : notnull

Summary: Uses selector to determine which source in sources to return, choosing an empty sequence if no match is found.

Type parameters

NameDescription
TValueThe type of the value returned by the selector function, used to look up the resulting source.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
selectorExpression>Selector function invoked to determine the source to lookup in the sources dictionary.
sourcesIDictionary>Dictionary of sources to select from based on the selector invocation result.

Returns: IQbservable -- The observable sequence retrieved from the sources dictionary based on the selector invocation result, or an empty sequence if no match is found.

Exceptions

TypeCondition
System.ArgumentNullExceptionselector or sources is null.

2. Overload

public static IQbservable<TResult> Case<TValue, TResult>(this IQbservableProvider provider, Expression<Func<TValue>> selector, IDictionary<TValue, IObservable<TResult>> sources, IObservable<TResult> defaultSource) where TValue : notnull

Summary: Uses selector to determine which source in sources to return, choosing defaultSource if no match is found.

Type parameters

NameDescription
TValueThe type of the value returned by the selector function, used to look up the resulting source.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
selectorExpression>Selector function invoked to determine the source to lookup in the sources dictionary.
sourcesIDictionary>Dictionary of sources to select from based on the selector invocation result.
defaultSourceIObservableDefault source to select in case no matching source in sources is found.

Returns: IQbservable -- The observable sequence retrieved from the sources dictionary based on the selector invocation result, or defaultSource if no match is found.

Exceptions

TypeCondition
System.ArgumentNullExceptionselector or sources or defaultSource is null.

3. Overload

public static IQbservable<TResult> Case<TValue, TResult>(this IQbservableProvider provider, Expression<Func<TValue>> selector, IDictionary<TValue, IObservable<TResult>> sources, IScheduler scheduler) where TValue : notnull

Summary: Uses selector to determine which source in sources to return, choosing an empty sequence on the specified scheduler if no match is found.

Type parameters

NameDescription
TValueThe type of the value returned by the selector function, used to look up the resulting source.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
selectorExpression>Selector function invoked to determine the source to lookup in the sources dictionary.
sourcesIDictionary>Dictionary of sources to select from based on the selector invocation result.
scheduler[IScheduler](#Scheduler to generate an empty sequence on in case no matching source in sources is found.

Returns: IQbservable -- The observable sequence retrieved from the sources dictionary based on the selector invocation result, or an empty sequence if no match is found.

Exceptions

TypeCondition
System.ArgumentNullExceptionselector or sources or scheduler is null.