ExperimentalEnumerableAggregateT, TResult1, TResult2, TResult3, TResult4, TResult5, TResult6, TResult(IEnumerableT, FuncIObservableT, IObservableTResult1, FuncIObservableT, IObservableTResult2, FuncIObservableT, IObservableTResult3, FuncIObservableT, IObservableTResult4, FuncIObservableT, IObservableTResult5, FuncIObservableT, IObservableTResult6, FuncTResult1, TResult2, TResult3, TResult4, TResult5, TResult6, TResult) Method

Applies six accumulator queries sequentially in a single pass over a sequence.

Definition

Namespace: MoreLinq.Experimental
Assembly: MoreLinq (in MoreLinq.dll) Version: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
C#
public static TResult Aggregate<T, TResult1, TResult2, TResult3, TResult4, TResult5, TResult6, TResult>(
	this IEnumerable<T> source,
	Func<IObservable<T>, IObservable<TResult1>> accumulator1,
	Func<IObservable<T>, IObservable<TResult2>> accumulator2,
	Func<IObservable<T>, IObservable<TResult3>> accumulator3,
	Func<IObservable<T>, IObservable<TResult4>> accumulator4,
	Func<IObservable<T>, IObservable<TResult5>> accumulator5,
	Func<IObservable<T>, IObservable<TResult6>> accumulator6,
	Func<TResult1, TResult2, TResult3, TResult4, TResult5, TResult6, TResult> resultSelector
)

Parameters

source  IEnumerableT
The source sequence
accumulator1  FuncIObservableT, IObservableTResult1
The first accumulator.
accumulator2  FuncIObservableT, IObservableTResult2
The second accumulator.
accumulator3  FuncIObservableT, IObservableTResult3
The third accumulator.
accumulator4  FuncIObservableT, IObservableTResult4
The fourth accumulator.
accumulator5  FuncIObservableT, IObservableTResult5
The fifth accumulator.
accumulator6  FuncIObservableT, IObservableTResult6
The sixth accumulator.
resultSelector  FuncTResult1, TResult2, TResult3, TResult4, TResult5, TResult6, TResult
A function that projects a single result given the result of each accumulator.

Type Parameters

T
The type of elements in source.
TResult1
The type of the result of the first accumulator.
TResult2
The type of the result of the second accumulator.
TResult3
The type of the result of the third accumulator.
TResult4
The type of the result of the fourth accumulator.
TResult5
The type of the result of the fifth accumulator.
TResult6
The type of the result of the sixth accumulator.
TResult
The type of the accumulated result.

Return Value

TResult
The value returned by resultSelector.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

This operator executes immediately.

Each accumulator argument is a function that receives an IObservableT, which when subscribed to, produces the items in the source sequence and in original order; the function must then return an IObservableT that produces a single aggregate on completion (when OnCompleted is called. An error is raised at run-time if the IObserverT returned by an accumulator function produces no result or produces more than a single result.

Exceptions

InvalidOperationException An IObservableT returned by an accumulator function produced zero or more than a single aggregate result.

See Also