Skip to content

Applies to

netstandard2.0

public static IQbservable<TSource> While<TSource>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TSource> source)

Summary: Repeats the given source as long as the specified condition holds, where the condition is evaluated before each repeated source is subscribed to.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
conditionExpression>Condition that will be evaluated before subscription to the source, to determine whether repetition of the source is required.
sourceIObservableSource to repeat as long as the condition function evaluates to true.

Returns: IQbservable -- The observable sequence obtained by concatenating the source sequence as long as the condition holds.

Exceptions

TypeCondition
System.ArgumentNullExceptioncondition or source is null.