},System.IObservable{--0})} },System.IObservable{--0},System.IObservable{--0})} },System.IObservable{--0},System.Reactive.Concurrency.IScheduler)}
Qbservable.If(IQbservableProvider, Expression>, IObservable) method¶
Defined in
Type: Qbservable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource) - 2.
public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource, IObservable<TResult> elseSource) - 3.
public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource, IScheduler scheduler)
1. Overload¶
public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource)
Summary:
If the specified condition evaluates true, select the thenSource sequence. Otherwise, return an empty sequence.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
condition | Expression | Condition evaluated to decide which sequence to return. |
thenSource | IObservable | Sequence returned in case condition evaluates true. |
Returns: IQbservablethenSource if condition evaluates true; an empty sequence otherwise.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or thenSource is null. |
2. Overload¶
public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource, IObservable<TResult> elseSource)
Summary:
If the specified condition evaluates true, select the thenSource sequence. Otherwise, select the elseSource sequence.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
condition | Expression | Condition evaluated to decide which sequence to return. |
thenSource | IObservable | Sequence returned in case condition evaluates true. |
elseSource | IObservable | Sequence returned in case condition evaluates false. |
Returns: IQbservablethenSource if condition evaluates true; elseSource otherwise.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or thenSource or elseSource is null. |
3. Overload¶
public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource, IScheduler scheduler)
Summary:
If the specified condition evaluates true, select the thenSource sequence. Otherwise, return an empty sequence generated on the specified scheduler.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
condition | Expression | Condition evaluated to decide which sequence to return. |
thenSource | IObservable | Sequence returned in case condition evaluates true. |
scheduler | [IScheduler](# | Scheduler to generate an empty sequence on in case condition evaluates false. |
Returns: IQbservablethenSource if condition evaluates true; an empty sequence otherwise.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or thenSource or scheduler is null. |