Skip to content

,System.Int32,System.Linq.Expressions.Expression})}

Qbservable.AutoConnect(IQbservableProvider, IConnectableObservable, int, Expression>) method

Defined in

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

Applies to

netstandard2.0

public static IQbservable<TSource> AutoConnect<TSource>(this IQbservableProvider provider, IConnectableObservable<TSource> source, int minObservers, Expression<Action<IDisposable>> onConnect)

Summary: Automatically connect the upstream IConnectableObservable at most once when the specified number of IObservers have subscribed to this IObservable.

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.
source[IConnectableObservable](#Connectable observable sequence.
minObserversintThe number of observers required to subscribe before the connection to source happens, non-positive value will trigger an immediate subscription.
onConnectExpression>If not null, the connection's IDisposable is provided to it.

Returns: IQbservable -- An observable sequence that connects to the source at most once when the given number of observers have subscribed to it.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.