Skip to content

,System.Linq.Expressions.Expression{System.Func{--1}},System.Linq.Expressions.Expression{System.Func{--1,--0,--1}},System.Linq.Expressions.Expression{System.Func{--1,--1}})} ,System.Linq.Expressions.Expression{System.Func{--1}},System.Linq.Expressions.Expression{System.Func{--1,--0,--1}})}

Qbservable.Collect(IQbservable, Expression>, Expression>, Expression>) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IQueryable<TResult> Collect<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TResult>> getInitialCollector, Expression<Func<TResult, TSource, TResult>> merge, Expression<Func<TResult, TResult>> getNewCollector)
  • 2. public static IQueryable<TResult> Collect<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TResult>> newCollector, Expression<Func<TResult, TSource, TResult>> merge)

1. Overload

public static IQueryable<TResult> Collect<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TResult>> getInitialCollector, Expression<Func<TResult, TSource, TResult>> merge, Expression<Func<TResult, TResult>> getNewCollector)

Summary: Produces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements produced by the merge operation during collection.

Parameters

NameTypeDescription
source[IQbservable](#Source observable sequence.
getInitialCollectorExpression>Factory to create the initial collector object.
mergeExpression>Merges a sequence element with the current collector.
getNewCollectorExpression>Factory to replace the current collector by a new collector.

Returns: IQueryable -- The enumerable sequence that returns collected/aggregated elements from the source sequence upon each iteration.

Remarks

This operator requires the source's IQbservableProvider object (see Provider) to implement IQueryProvider.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or getInitialCollector or merge or getNewCollector is null.

2. Overload

public static IQueryable<TResult> Collect<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TResult>> newCollector, Expression<Func<TResult, TSource, TResult>> merge)

Summary: Produces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements produced by the merge operation during collection.

Parameters

NameTypeDescription
source[IQbservable](#Source observable sequence.
newCollectorExpression>Factory to create a new collector object.
mergeExpression>Merges a sequence element with the current collector.

Returns: IQueryable -- The enumerable sequence that returns collected/aggregated elements from the source sequence upon each iteration.

Remarks

This operator requires the source's IQbservableProvider object (see Provider) to implement IQueryProvider.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or newCollector or merge is null.