Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Applies in parallel an accumulator function over a sequence.
Applies in parallel an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
public:
generic <typename TSource, typename TAccumulate, typename TResult>
[System::Runtime::CompilerServices::Extension]
static TResult Aggregate(System::Linq::ParallelQuery<TSource> ^ source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> ^ func, Func<TAccumulate, TResult> ^ resultSelector);
public static TResult Aggregate<TSource,TAccumulate,TResult>(this System.Linq.ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> func, Func<TAccumulate,TResult> resultSelector);
static member Aggregate : System.Linq.ParallelQuery<'Source> * 'Accumulate * Func<'Accumulate, 'Source, 'Accumulate> * Func<'Accumulate, 'Result> -> 'Result
<Extension()>
Public Function Aggregate(Of TSource, TAccumulate, TResult) (source As ParallelQuery(Of TSource), seed As TAccumulate, func As Func(Of TAccumulate, TSource, TAccumulate), resultSelector As Func(Of TAccumulate, TResult)) As TResult
The type of the elements of source
.
The type of the accumulator value.
The type of the resulting value.
A sequence to aggregate over.
The initial accumulator value.
An accumulator function to be invoked on each element.
A function to transform the final accumulator value into the result value.
The transformed final accumulator value.
The query was canceled with the token passed in through WithCancellation<TSource>(ParallelQuery<TSource>, CancellationToken).
source
or func
or resultSelector
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
source
contains no elements.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Applies in parallel an accumulator function over a sequence. This overload is not available in the sequential implementation.
public:
generic <typename TSource, typename TAccumulate, typename TResult>
[System::Runtime::CompilerServices::Extension]
static TResult Aggregate(System::Linq::ParallelQuery<TSource> ^ source, Func<TAccumulate> ^ seedFactory, Func<TAccumulate, TSource, TAccumulate> ^ updateAccumulatorFunc, Func<TAccumulate, TAccumulate, TAccumulate> ^ combineAccumulatorsFunc, Func<TAccumulate, TResult> ^ resultSelector);
public static TResult Aggregate<TSource,TAccumulate,TResult>(this System.Linq.ParallelQuery<TSource> source, Func<TAccumulate> seedFactory, Func<TAccumulate,TSource,TAccumulate> updateAccumulatorFunc, Func<TAccumulate,TAccumulate,TAccumulate> combineAccumulatorsFunc, Func<TAccumulate,TResult> resultSelector);
static member Aggregate : System.Linq.ParallelQuery<'Source> * Func<'Accumulate> * Func<'Accumulate, 'Source, 'Accumulate> * Func<'Accumulate, 'Accumulate, 'Accumulate> * Func<'Accumulate, 'Result> -> 'Result
<Extension()>
Public Function Aggregate(Of TSource, TAccumulate, TResult) (source As ParallelQuery(Of TSource), seedFactory As Func(Of TAccumulate), updateAccumulatorFunc As Func(Of TAccumulate, TSource, TAccumulate), combineAccumulatorsFunc As Func(Of TAccumulate, TAccumulate, TAccumulate), resultSelector As Func(Of TAccumulate, TResult)) As TResult
The type of the elements of source
.
The type of the accumulator value.
The type of the resulting value.
A sequence to aggregate over.
A function that returns the initial accumulator value.
An accumulator function to be invoked on each element in a partition.
An accumulator function to be invoked on the yielded accumulator result from each partition.
A function to transform the final accumulator value into the result value.
The transformed final accumulator value.
The query was canceled with the token passed in through WithCancellation<TSource>(ParallelQuery<TSource>, CancellationToken).
source
or seedFactory
or updateAccumulatorFunc
or combineAccumulatorsFunc
or resultSelector
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
source
contains no elements.
This overload is specific to parallelized queries. A parallelized query may partition the data source sequence into several sub-sequences (partitions). The updateAccumulatorFunc
is invoked on each element within partitions. Each partition then yields a single accumulated result. The combineAccumulatorsFunc
is then invoked on the results of each partition to yield a single element. This element is then transformed by the resultSelector
function.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Applies in parallel an accumulator function over a sequence. This overload is not available in the sequential implementation.
public:
generic <typename TSource, typename TAccumulate, typename TResult>
[System::Runtime::CompilerServices::Extension]
static TResult Aggregate(System::Linq::ParallelQuery<TSource> ^ source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> ^ updateAccumulatorFunc, Func<TAccumulate, TAccumulate, TAccumulate> ^ combineAccumulatorsFunc, Func<TAccumulate, TResult> ^ resultSelector);
public static TResult Aggregate<TSource,TAccumulate,TResult>(this System.Linq.ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> updateAccumulatorFunc, Func<TAccumulate,TAccumulate,TAccumulate> combineAccumulatorsFunc, Func<TAccumulate,TResult> resultSelector);
static member Aggregate : System.Linq.ParallelQuery<'Source> * 'Accumulate * Func<'Accumulate, 'Source, 'Accumulate> * Func<'Accumulate, 'Accumulate, 'Accumulate> * Func<'Accumulate, 'Result> -> 'Result
<Extension()>
Public Function Aggregate(Of TSource, TAccumulate, TResult) (source As ParallelQuery(Of TSource), seed As TAccumulate, updateAccumulatorFunc As Func(Of TAccumulate, TSource, TAccumulate), combineAccumulatorsFunc As Func(Of TAccumulate, TAccumulate, TAccumulate), resultSelector As Func(Of TAccumulate, TResult)) As TResult
The type of the elements of source
.
The type of the accumulator value.
The type of the resulting value.
A sequence to aggregate over.
The initial accumulator value.
An accumulator function to be invoked on each element in a partition.
An accumulator function to be invoked on the yielded accumulator result from each partition.
A function to transform the final accumulator value into the result value.
The transformed final accumulator value.
The query was canceled with the token passed in through WithCancellation<TSource>(ParallelQuery<TSource>, CancellationToken).
source
or updateAccumulatorFunc
or combineAccumulatorsFunc
or resultSelector
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
source
contains no elements.
This overload is specific to processing a parallelized query. A parallelized query may partition the data source sequence into several sub-sequences (partitions). The updateAccumulatorFunc
is invoked on each element within partitions. Each partition then yields a single accumulated result. The combineAccumulatorsFunc
is then invoked on the results of each partition to yield a single element. This element is then transformed by the resultSelector
function.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Applies in parallel an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
public:
generic <typename TSource, typename TAccumulate>
[System::Runtime::CompilerServices::Extension]
static TAccumulate Aggregate(System::Linq::ParallelQuery<TSource> ^ source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> ^ func);
public static TAccumulate Aggregate<TSource,TAccumulate>(this System.Linq.ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> func);
static member Aggregate : System.Linq.ParallelQuery<'Source> * 'Accumulate * Func<'Accumulate, 'Source, 'Accumulate> -> 'Accumulate
<Extension()>
Public Function Aggregate(Of TSource, TAccumulate) (source As ParallelQuery(Of TSource), seed As TAccumulate, func As Func(Of TAccumulate, TSource, TAccumulate)) As TAccumulate
The type of the elements of source
.
The type of the accumulator value.
A sequence to aggregate over.
The initial accumulator value.
An accumulator function to be invoked on each element.
The final accumulator value.
The query was canceled with the token passed in through WithCancellation<TSource>(ParallelQuery<TSource>, CancellationToken).
source
or func
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
source
contains no elements.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Applies in parallel an accumulator function over a sequence.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static TSource Aggregate(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, TSource, TSource> ^ func);
public static TSource Aggregate<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,TSource,TSource> func);
static member Aggregate : System.Linq.ParallelQuery<'Source> * Func<'Source, 'Source, 'Source> -> 'Source
<Extension()>
Public Function Aggregate(Of TSource) (source As ParallelQuery(Of TSource), func As Func(Of TSource, TSource, TSource)) As TSource
The type of the elements of source
.
A sequence to aggregate over.
An accumulator function to be invoked on each element.
The final accumulator value.
The query was canceled with the token passed in through WithCancellation<TSource>(ParallelQuery<TSource>, CancellationToken).
source
or func
is a null reference (Nothing in Visual Basic).
One or more exceptions occurred during the evaluation of the query.
source
contains no elements.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in