Click or drag to resize

ExperimentalEnumerable.Aggregate<T, TResult1, TResult2, TResult3, TResult4, TResult5, TResult> Method (IEnumerable<T>, Func<IObservable<T>, IObservable<TResult1>>, Func<IObservable<T>, IObservable<TResult2>>, Func<IObservable<T>, IObservable<TResult3>>, Func<IObservable<T>, IObservable<TResult4>>, Func<IObservable<T>, IObservable<TResult5>>, Func<TResult1, TResult2, TResult3, TResult4, TResult5, TResult>)

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

Namespace:  MoreLinq.Experimental
Assembly:  MoreLinq (in MoreLinq.dll) Version: 3.2.0+5205ea241d72b079436060d330cd5c2eae7cdcdf
Syntax
public static TResult Aggregate<T, TResult1, TResult2, TResult3, TResult4, TResult5, 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<TResult1, TResult2, TResult3, TResult4, TResult5, TResult> resultSelector
)

Parameters

source
Type: System.Collections.Generic.IEnumerable<T>
The source sequence
accumulator1
Type: System.Func<IObservable<T>, IObservable<TResult1>>
The first accumulator.
accumulator2
Type: System.Func<IObservable<T>, IObservable<TResult2>>
The second accumulator.
accumulator3
Type: System.Func<IObservable<T>, IObservable<TResult3>>
The third accumulator.
accumulator4
Type: System.Func<IObservable<T>, IObservable<TResult4>>
The fourth accumulator.
accumulator5
Type: System.Func<IObservable<T>, IObservable<TResult5>>
The fifth accumulator.
resultSelector
Type: System.Func<TResult1, TResult2, TResult3, TResult4, TResult5, 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.
TResult
The type of the accumulated result.

Return Value

Type: 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 IEnumerable<T>. 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).
Exceptions
Remarks

This operator executes immediately.

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

See Also