AggregateExtensionAggregateT, TAccumulate1, TAccumulate2, TAccumulate3, TResult Method (IEnumerableT, TAccumulate1, FuncTAccumulate1, T, TAccumulate1, TAccumulate2, FuncTAccumulate2, T, TAccumulate2, TAccumulate3, FuncTAccumulate3, T, TAccumulate3, FuncTAccumulate1, TAccumulate2, TAccumulate3, TResult) |
Applies three accumulators sequentially in a single pass over a
sequence.
Namespace:
MoreLinq.Extensions
Assembly:
MoreLinq (in MoreLinq.dll) Version: 3.3.1+b77df70598ab84c28cd43dcf74594024b6d575e1
Syntax public static TResult Aggregate<T, TAccumulate1, TAccumulate2, TAccumulate3, TResult>(
this IEnumerable<T> source,
TAccumulate1 seed1,
Func<TAccumulate1, T, TAccumulate1> accumulator1,
TAccumulate2 seed2,
Func<TAccumulate2, T, TAccumulate2> accumulator2,
TAccumulate3 seed3,
Func<TAccumulate3, T, TAccumulate3> accumulator3,
Func<TAccumulate1, TAccumulate2, TAccumulate3, TResult> resultSelector
)
<ExtensionAttribute>
Public Shared Function Aggregate(Of T, TAccumulate1, TAccumulate2, TAccumulate3, TResult) (
source As IEnumerable(Of T),
seed1 As TAccumulate1,
accumulator1 As Func(Of TAccumulate1, T, TAccumulate1),
seed2 As TAccumulate2,
accumulator2 As Func(Of TAccumulate2, T, TAccumulate2),
seed3 As TAccumulate3,
accumulator3 As Func(Of TAccumulate3, T, TAccumulate3),
resultSelector As Func(Of TAccumulate1, TAccumulate2, TAccumulate3, TResult)
) As TResult
public:
[ExtensionAttribute]
generic<typename T, typename TAccumulate1, typename TAccumulate2, typename TAccumulate3, typename TResult>
static TResult Aggregate(
IEnumerable<T>^ source,
TAccumulate1 seed1,
Func<TAccumulate1, T, TAccumulate1>^ accumulator1,
TAccumulate2 seed2,
Func<TAccumulate2, T, TAccumulate2>^ accumulator2,
TAccumulate3 seed3,
Func<TAccumulate3, T, TAccumulate3>^ accumulator3,
Func<TAccumulate1, TAccumulate2, TAccumulate3, TResult>^ resultSelector
)
[<ExtensionAttribute>]
static member Aggregate :
source : IEnumerable<'T> *
seed1 : 'TAccumulate1 *
accumulator1 : Func<'TAccumulate1, 'T, 'TAccumulate1> *
seed2 : 'TAccumulate2 *
accumulator2 : Func<'TAccumulate2, 'T, 'TAccumulate2> *
seed3 : 'TAccumulate3 *
accumulator3 : Func<'TAccumulate3, 'T, 'TAccumulate3> *
resultSelector : Func<'TAccumulate1, 'TAccumulate2, 'TAccumulate3, 'TResult> -> 'TResult
Parameters
- source
- Type: System.Collections.GenericIEnumerableT
The source sequence - seed1
- Type: TAccumulate1
The seed value for the first accumulator. - accumulator1
- Type: SystemFuncTAccumulate1, T, TAccumulate1
The first accumulator. - seed2
- Type: TAccumulate2
The seed value for the second accumulator. - accumulator2
- Type: SystemFuncTAccumulate2, T, TAccumulate2
The second accumulator. - seed3
- Type: TAccumulate3
The seed value for the third accumulator. - accumulator3
- Type: SystemFuncTAccumulate3, T, TAccumulate3
The third accumulator. - resultSelector
- Type: SystemFuncTAccumulate1, TAccumulate2, TAccumulate3, TResult
A function that projects a single result given the result of each
accumulator.
Type Parameters
- T
- The type of elements in source.
- TAccumulate1
- The type of first accumulator value.
- TAccumulate2
- The type of second accumulator value.
- TAccumulate3
- The type of third accumulator value.
- TResult
- The type of the accumulated result.
Return Value
Type:
TResultThe 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.
See Also