ParallelEnumerable.Average Method

Definition

Computes in parallel the average of a sequence of values.

Overloads

Average(ParallelQuery<Single>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Nullable<Int64>>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Nullable<Int32>>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Nullable<Double>>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Nullable<Single>>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Int64>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Int32>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Double>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Decimal>)

Computes in parallel the average of a sequence of values.

Average(ParallelQuery<Nullable<Decimal>>)

Computes in parallel the average of a sequence of values.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Single>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Int64>>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Int32>>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Double>>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Single>>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Int64>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Int32>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Double>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Decimal>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Decimal>>)

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

Average(ParallelQuery<Single>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static float Average(this System.Linq.ParallelQuery<float> source);

Parameters

source
ParallelQuery<Single>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Nullable<Int64>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static double? Average(this System.Linq.ParallelQuery<long?> source);

Parameters

source
ParallelQuery<Nullable<Int64>>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Nullable<Int32>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static double? Average(this System.Linq.ParallelQuery<int?> source);

Parameters

source
ParallelQuery<Nullable<Int32>>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Nullable<Double>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static double? Average(this System.Linq.ParallelQuery<double?> source);

Parameters

source
ParallelQuery<Nullable<Double>>

The source sequence.

Returns

The average of the sequence of values.

Exceptions

source is null.

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Nullable<Single>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static float? Average(this System.Linq.ParallelQuery<float?> source);

Parameters

source
ParallelQuery<Nullable<Single>>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Int64>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static double Average(this System.Linq.ParallelQuery<long> source);

Parameters

source
ParallelQuery<Int64>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Int32>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static double Average(this System.Linq.ParallelQuery<int> source);

Parameters

source
ParallelQuery<Int32>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Double>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static double Average(this System.Linq.ParallelQuery<double> source);

Parameters

source
ParallelQuery<Double>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Decimal>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static decimal Average(this System.Linq.ParallelQuery<decimal> source);

Parameters

source
ParallelQuery<Decimal>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average(ParallelQuery<Nullable<Decimal>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values.

C#
public static decimal? Average(this System.Linq.ParallelQuery<decimal?> source);

Parameters

source
ParallelQuery<Nullable<Decimal>>

A sequence of values that are used to calculate an average.

Returns

The average of the sequence of values.

Exceptions

source is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Single>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static float Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,float> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Single>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Int64>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static double? Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,long?> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Nullable<Int64>>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int64.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Int32>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static double? Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,int?> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Nullable<Int32>>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Double>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static double? Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,double?> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Nullable<Double>>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Single>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static float? Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,float?> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Nullable<Single>>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Int64>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static double Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,long> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Int64>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Int32>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static double Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,int> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Int32>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

The sum or count of the elements in the sequence is larger than Int32.MaxValue. -or- One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Double>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static double Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,double> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Double>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Decimal>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static decimal Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,decimal> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Decimal>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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

Average<TSource>(ParallelQuery<TSource>, Func<TSource,Nullable<Decimal>>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

C#
public static decimal? Average<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,decimal?> selector);

Type Parameters

TSource

The type of elements of source.

Parameters

source
ParallelQuery<TSource>

A sequence of values that are used to calculate an average.

selector
Func<TSource,Nullable<Decimal>>

A transform function to apply to each element.

Returns

The average of the sequence of values.

Exceptions

source or selector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

source contains no elements.

(Thrown as inner exception in an AggregateException). The selector function returns a value greater than MaxValue for the element type.

See also

Applies to

.NET 10 and other versions
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