ParallelEnumerable.Average 方法

定义

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

重载

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>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static float Average(System::Linq::ParallelQuery<float> ^ source);
public static float Average (this System.Linq.ParallelQuery<float> source);
static member Average : System.Linq.ParallelQuery<single> -> single
<Extension()>
Public Function Average (source As ParallelQuery(Of Single)) As Single

参数

source
ParallelQuery<Single>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Nullable<Int64>>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static Nullable<double> Average(System::Linq::ParallelQuery<Nullable<long>> ^ source);
public static Nullable<double> Average (this System.Linq.ParallelQuery<Nullable<long>> source);
static member Average : System.Linq.ParallelQuery<Nullable<int64>> -> Nullable<double>
<Extension()>
Public Function Average (source As ParallelQuery(Of Nullable(Of Long))) As Nullable(Of Double)

参数

source
ParallelQuery<Nullable<Int64>>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Nullable<Int32>>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static Nullable<double> Average(System::Linq::ParallelQuery<Nullable<int>> ^ source);
public static Nullable<double> Average (this System.Linq.ParallelQuery<Nullable<int>> source);
static member Average : System.Linq.ParallelQuery<Nullable<int>> -> Nullable<double>
<Extension()>
Public Function Average (source As ParallelQuery(Of Nullable(Of Integer))) As Nullable(Of Double)

参数

source
ParallelQuery<Nullable<Int32>>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Nullable<Double>>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static Nullable<double> Average(System::Linq::ParallelQuery<Nullable<double>> ^ source);
public static Nullable<double> Average (this System.Linq.ParallelQuery<Nullable<double>> source);
static member Average : System.Linq.ParallelQuery<Nullable<double>> -> Nullable<double>
<Extension()>
Public Function Average (source As ParallelQuery(Of Nullable(Of Double))) As Nullable(Of Double)

参数

source
ParallelQuery<Nullable<Double>>

源序列。The source sequence.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

用于计算平均值的值序列。值序列的平均值。sourceA sequence of values that are used to calculate an average.The average of the sequence of values.source 为 null 引用(在 Visual Basic 中为 Nothing)。is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Nullable<Single>>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static Nullable<float> Average(System::Linq::ParallelQuery<Nullable<float>> ^ source);
public static Nullable<float> Average (this System.Linq.ParallelQuery<Nullable<float>> source);
static member Average : System.Linq.ParallelQuery<Nullable<single>> -> Nullable<single>
<Extension()>
Public Function Average (source As ParallelQuery(Of Nullable(Of Single))) As Nullable(Of Single)

参数

source
ParallelQuery<Nullable<Single>>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Int64>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static double Average(System::Linq::ParallelQuery<long> ^ source);
public static double Average (this System.Linq.ParallelQuery<long> source);
static member Average : System.Linq.ParallelQuery<int64> -> double
<Extension()>
Public Function Average (source As ParallelQuery(Of Long)) As Double

参数

source
ParallelQuery<Int64>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Int32>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static double Average(System::Linq::ParallelQuery<int> ^ source);
public static double Average (this System.Linq.ParallelQuery<int> source);
static member Average : System.Linq.ParallelQuery<int> -> double
<Extension()>
Public Function Average (source As ParallelQuery(Of Integer)) As Double

参数

source
ParallelQuery<Int32>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Double>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static double Average(System::Linq::ParallelQuery<double> ^ source);
public static double Average (this System.Linq.ParallelQuery<double> source);
static member Average : System.Linq.ParallelQuery<double> -> double
<Extension()>
Public Function Average (source As ParallelQuery(Of Double)) As Double

参数

source
ParallelQuery<Double>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Decimal>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Decimal Average(System::Linq::ParallelQuery<System::Decimal> ^ source);
public static decimal Average (this System.Linq.ParallelQuery<decimal> source);
static member Average : System.Linq.ParallelQuery<decimal> -> decimal
<Extension()>
Public Function Average (source As ParallelQuery(Of Decimal)) As Decimal

参数

source
ParallelQuery<Decimal>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

Average(ParallelQuery<Nullable<Decimal>>)

并行计算一个值序列的平均值。Computes in parallel the average of a sequence of values.

public:
[System::Runtime::CompilerServices::Extension]
 static Nullable<System::Decimal> Average(System::Linq::ParallelQuery<Nullable<System::Decimal>> ^ source);
public static Nullable<decimal> Average (this System.Linq.ParallelQuery<Nullable<decimal>> source);
static member Average : System.Linq.ParallelQuery<Nullable<decimal>> -> Nullable<decimal>
<Extension()>
Public Function Average (source As ParallelQuery(Of Nullable(Of Decimal))) As Nullable(Of Decimal)

参数

source
ParallelQuery<Nullable<Decimal>>

用于计算平均值的值序列。A sequence of values that are used to calculate an average.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static float Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, float> ^ selector);
public static float Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,float> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, single> -> single
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Single)) As Single

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static Nullable<double> Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, Nullable<long>> ^ selector);
public static Nullable<double> Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,Nullable<long>> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, Nullable<int64>> -> Nullable<double>
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Nullable(Of Long))) As Nullable(Of Double)

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static Nullable<double> Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, Nullable<int>> ^ selector);
public static Nullable<double> Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,Nullable<int>> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, Nullable<int>> -> Nullable<double>
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Nullable(Of Integer))) As Nullable(Of Double)

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static Nullable<double> Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, Nullable<double>> ^ selector);
public static Nullable<double> Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,Nullable<double>> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, Nullable<double>> -> Nullable<double>
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Nullable(Of Double))) As Nullable(Of Double)

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static Nullable<float> Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, Nullable<float>> ^ selector);
public static Nullable<float> Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,Nullable<float>> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, Nullable<single>> -> Nullable<single>
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Nullable(Of Single))) As Nullable(Of Single)

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static double Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, long> ^ selector);
public static double Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,long> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, int64> -> double
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Long)) As Double

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static double Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, int> ^ selector);
public static double Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,int> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, int> -> double
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Integer)) As Double

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

序列中元素之和或数量大于 MaxValueThe sum or count of the elements in the sequence is larger than MaxValue. 或评估查询期间发生一个或多个异常。-or- One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static double Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, double> ^ selector);
public static double Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,double> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, double> -> double
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Double)) As Double

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Decimal Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, System::Decimal> ^ selector);
public static decimal Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,decimal> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, decimal> -> decimal
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Decimal)) As Decimal

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

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.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static Nullable<System::Decimal> Average(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, Nullable<System::Decimal>> ^ selector);
public static Nullable<decimal> Average<TSource> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,Nullable<decimal>> selector);
static member Average : System.Linq.ParallelQuery<'Source> * Func<'Source, Nullable<decimal>> -> Nullable<decimal>
<Extension()>
Public Function Average(Of TSource) (source As ParallelQuery(Of TSource), selector As Func(Of TSource, Nullable(Of Decimal))) As Nullable(Of Decimal)

类型参数

TSource

source 的元素类型。The type of elements of source.

参数

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.

返回

值序列的平均值。The average of the sequence of values.

异常

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

sourceselector 为 null 引用(在 Visual Basic 中为 Nothing)。source or selector is a null reference (Nothing in Visual Basic).

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

source 中不包含任何元素。source contains no elements.

(在 AggregateException 中作为内部异常引发)。(Thrown as inner exception in an AggregateException). selector 函数返回一个大于元素类型的 MaxValue 的值。The selector function returns a value greater than MaxValue for the element type.

另请参阅

适用于