Skip to content

)}

Observable.ToArray(IObservable) method

Defined in

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

Applies to

netstandard2.0

public static IObservable<TSource[]> ToArray<TSource>(this IObservable<TSource> source)

Summary: Creates an array from an observable sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableThe source observable sequence to get an array of elements for.

Returns: IObservable -- An observable sequence containing a single element with an array containing all the elements of the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.