,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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements produced by the merge operation during collection. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | Source observable sequence. |
getInitialCollector | Expression | Factory to create the initial collector object. |
merge | Expression | Merges a sequence element with the current collector. |
getNewCollector | Expression | Factory to replace the current collector by a new collector. |
Returns: IQueryable
Remarks
This operator requires the source's IQbservableProvider object (see Provider) to implement IQueryProvider.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source 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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements produced by the merge operation during collection. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | Source observable sequence. |
newCollector | Expression | Factory to create a new collector object. |
merge | Expression | Merges a sequence element with the current collector. |
Returns: IQueryable
Remarks
This operator requires the source's IQbservableProvider object (see Provider) to implement IQueryProvider.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or newCollector or merge is null. |