Share via


QueryableExtensions.AverageAsync Method

Definition

Overloads

AverageAsync(IQueryable<Single>, CancellationToken)

Asynchronously computes the average of a sequence of Single values.

AverageAsync(IQueryable<Nullable<Single>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Single values.

AverageAsync(IQueryable<Nullable<Int64>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int64 values.

AverageAsync(IQueryable<Nullable<Int32>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int32 values.

AverageAsync(IQueryable<Nullable<Double>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Double values.

AverageAsync(IQueryable<Nullable<Decimal>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Decimal values.

AverageAsync(IQueryable<Int64>, CancellationToken)

Asynchronously computes the average of a sequence of Int64 values.

AverageAsync(IQueryable<Int32>, CancellationToken)

Asynchronously computes the average of a sequence of Int32 values.

AverageAsync(IQueryable<Double>, CancellationToken)

Asynchronously computes the average of a sequence of Double values.

AverageAsync(IQueryable<Decimal>, CancellationToken)

Asynchronously computes the average of a sequence of Decimal values.

AverageAsync(IQueryable<Single>)

Asynchronously computes the average of a sequence of Single values.

AverageAsync(IQueryable<Nullable<Single>>)

Asynchronously computes the average of a sequence of nullable Single values.

AverageAsync(IQueryable<Nullable<Int64>>)

Asynchronously computes the average of a sequence of nullable Int64 values.

AverageAsync(IQueryable<Nullable<Int32>>)

Asynchronously computes the average of a sequence of nullable Int32 values.

AverageAsync(IQueryable<Nullable<Double>>)

Asynchronously computes the average of a sequence of nullable Double values.

AverageAsync(IQueryable<Nullable<Decimal>>)

Asynchronously computes the average of a sequence of nullable Decimal values.

AverageAsync(IQueryable<Int64>)

Asynchronously computes the average of a sequence of Int64 values.

AverageAsync(IQueryable<Int32>)

Asynchronously computes the average of a sequence of Int32 values.

AverageAsync(IQueryable<Double>)

Asynchronously computes the average of a sequence of Double values.

AverageAsync(IQueryable<Decimal>)

Asynchronously computes the average of a sequence of Decimal values.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int32>>, CancellationToken)

Asynchronously computes the average of a sequence of Int32 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int64>>, CancellationToken)

Asynchronously computes the average of a sequence of Int64 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Decimal>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Decimal values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Double>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Double values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Single>>, CancellationToken)

Asynchronously computes the average of a sequence of Single values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int64>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int64 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Single>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Single values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Double>>, CancellationToken)

Asynchronously computes the average of a sequence of Double values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int32>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int32 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Decimal>>, CancellationToken)

Asynchronously computes the average of a sequence of Decimal values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int64>>>)

Asynchronously computes the average of a sequence of nullable Int64 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Single>>>)

Asynchronously computes the average of a sequence of nullable Single values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int32>>>)

Asynchronously computes the average of a sequence of nullable Int32 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Double>>>)

Asynchronously computes the average of a sequence of nullable Double values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Decimal>>>)

Asynchronously computes the average of a sequence of nullable Decimal values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int64>>)

Asynchronously computes the average of a sequence of Int64 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int32>>)

Asynchronously computes the average of a sequence of Int32 values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Double>>)

Asynchronously computes the average of a sequence of Double values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Decimal>>)

Asynchronously computes the average of a sequence of Decimal values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Single>>)

Asynchronously computes the average of a sequence of Single values that is obtained by invoking a projection function on each element of the input sequence.

AverageAsync(IQueryable<Single>, CancellationToken)

Asynchronously computes the average of a sequence of Single values.

public static System.Threading.Tasks.Task<float> AverageAsync (this System.Linq.IQueryable<float> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<single> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<single>

Parameters

source
IQueryable<Single>

A sequence of Single values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Single>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Single values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<float>> AverageAsync (this System.Linq.IQueryable<Nullable<float>> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<Nullable<single>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<single>>

Parameters

source
IQueryable<Nullable<Single>>

A sequence of nullable Single values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Int64>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int64 values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync (this System.Linq.IQueryable<Nullable<long>> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<Nullable<int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<double>>

Parameters

source
IQueryable<Nullable<Int64>>

A sequence of nullable Int64 values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Int32>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int32 values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync (this System.Linq.IQueryable<Nullable<int>> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<Nullable<int>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<double>>

Parameters

source
IQueryable<Nullable<Int32>>

A sequence of nullable Int32 values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Double>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Double values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync (this System.Linq.IQueryable<Nullable<double>> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<Nullable<double>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<double>>

Parameters

source
IQueryable<Nullable<Double>>

A sequence of nullable Double values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Decimal>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Decimal values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<decimal>> AverageAsync (this System.Linq.IQueryable<Nullable<decimal>> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<Nullable<decimal>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<decimal>>

Parameters

source
IQueryable<Nullable<Decimal>>

A sequence of nullable Decimal values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Int64>, CancellationToken)

Asynchronously computes the average of a sequence of Int64 values.

public static System.Threading.Tasks.Task<double> AverageAsync (this System.Linq.IQueryable<long> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>

Parameters

source
IQueryable<Int64>

A sequence of Int64 values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Int32>, CancellationToken)

Asynchronously computes the average of a sequence of Int32 values.

public static System.Threading.Tasks.Task<double> AverageAsync (this System.Linq.IQueryable<int> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>

Parameters

source
IQueryable<Int32>

A sequence of Int32 values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Double>, CancellationToken)

Asynchronously computes the average of a sequence of Double values.

public static System.Threading.Tasks.Task<double> AverageAsync (this System.Linq.IQueryable<double> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<double> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>

Parameters

source
IQueryable<Double>

A sequence of Double values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Decimal>, CancellationToken)

Asynchronously computes the average of a sequence of Decimal values.

public static System.Threading.Tasks.Task<decimal> AverageAsync (this System.Linq.IQueryable<decimal> source, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<decimal> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<decimal>

Parameters

source
IQueryable<Decimal>

A sequence of Decimal values to calculate the average of.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Single>)

Asynchronously computes the average of a sequence of Single values.

public static System.Threading.Tasks.Task<float> AverageAsync (this System.Linq.IQueryable<float> source);
static member AverageAsync : System.Linq.IQueryable<single> -> System.Threading.Tasks.Task<single>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Single)) As Task(Of Single)

Parameters

source
IQueryable<Single>

A sequence of Single values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Single>>)

Asynchronously computes the average of a sequence of nullable Single values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<float>> AverageAsync (this System.Linq.IQueryable<Nullable<float>> source);
static member AverageAsync : System.Linq.IQueryable<Nullable<single>> -> System.Threading.Tasks.Task<Nullable<single>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Single))) As Task(Of Nullable(Of Single))

Parameters

source
IQueryable<Nullable<Single>>

A sequence of nullable Single values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Int64>>)

Asynchronously computes the average of a sequence of nullable Int64 values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync (this System.Linq.IQueryable<Nullable<long>> source);
static member AverageAsync : System.Linq.IQueryable<Nullable<int64>> -> System.Threading.Tasks.Task<Nullable<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Long))) As Task(Of Nullable(Of Double))

Parameters

source
IQueryable<Nullable<Int64>>

A sequence of nullable Int64 values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Int32>>)

Asynchronously computes the average of a sequence of nullable Int32 values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync (this System.Linq.IQueryable<Nullable<int>> source);
static member AverageAsync : System.Linq.IQueryable<Nullable<int>> -> System.Threading.Tasks.Task<Nullable<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Integer))) As Task(Of Nullable(Of Double))

Parameters

source
IQueryable<Nullable<Int32>>

A sequence of nullable Int32 values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Double>>)

Asynchronously computes the average of a sequence of nullable Double values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync (this System.Linq.IQueryable<Nullable<double>> source);
static member AverageAsync : System.Linq.IQueryable<Nullable<double>> -> System.Threading.Tasks.Task<Nullable<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Double))) As Task(Of Nullable(Of Double))

Parameters

source
IQueryable<Nullable<Double>>

A sequence of nullable Double values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Nullable<Decimal>>)

Asynchronously computes the average of a sequence of nullable Decimal values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<decimal>> AverageAsync (this System.Linq.IQueryable<Nullable<decimal>> source);
static member AverageAsync : System.Linq.IQueryable<Nullable<decimal>> -> System.Threading.Tasks.Task<Nullable<decimal>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Decimal))) As Task(Of Nullable(Of Decimal))

Parameters

source
IQueryable<Nullable<Decimal>>

A sequence of nullable Decimal values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Int64>)

Asynchronously computes the average of a sequence of Int64 values.

public static System.Threading.Tasks.Task<double> AverageAsync (this System.Linq.IQueryable<long> source);
static member AverageAsync : System.Linq.IQueryable<int64> -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Long)) As Task(Of Double)

Parameters

source
IQueryable<Int64>

A sequence of Int64 values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Int32>)

Asynchronously computes the average of a sequence of Int32 values.

public static System.Threading.Tasks.Task<double> AverageAsync (this System.Linq.IQueryable<int> source);
static member AverageAsync : System.Linq.IQueryable<int> -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Integer)) As Task(Of Double)

Parameters

source
IQueryable<Int32>

A sequence of Int32 values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Double>)

Asynchronously computes the average of a sequence of Double values.

public static System.Threading.Tasks.Task<double> AverageAsync (this System.Linq.IQueryable<double> source);
static member AverageAsync : System.Linq.IQueryable<double> -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Double)) As Task(Of Double)

Parameters

source
IQueryable<Double>

A sequence of Double values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync(IQueryable<Decimal>)

Asynchronously computes the average of a sequence of Decimal values.

public static System.Threading.Tasks.Task<decimal> AverageAsync (this System.Linq.IQueryable<decimal> source);
static member AverageAsync : System.Linq.IQueryable<decimal> -> System.Threading.Tasks.Task<decimal>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Decimal)) As Task(Of Decimal)

Parameters

source
IQueryable<Decimal>

A sequence of Decimal values to calculate the average of.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Exceptions

source is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int32>>, CancellationToken)

Asynchronously computes the average of a sequence of Int32 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<double> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,int>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, int>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Int32>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int64>>, CancellationToken)

Asynchronously computes the average of a sequence of Int64 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<double> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,long>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Int64>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Decimal>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Decimal values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<decimal>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<decimal>>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<decimal>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<decimal>>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Decimal>>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Double>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Double values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<double>>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<double>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<double>>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Double>>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Single>>, CancellationToken)

Asynchronously computes the average of a sequence of Single values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<float> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,float>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, single>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<single>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Single>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int64>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int64 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<long>>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<int64>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<double>>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Int64>>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Single>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Single values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<float>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<float>>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<single>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<single>>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Single>>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Double>>, CancellationToken)

Asynchronously computes the average of a sequence of Double values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<double> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,double>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, double>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Double>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int32>>>, CancellationToken)

Asynchronously computes the average of a sequence of nullable Int32 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<int>>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<int>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<double>>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Int32>>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Decimal>>, CancellationToken)

Asynchronously computes the average of a sequence of Decimal values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<decimal> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,decimal>> selector, System.Threading.CancellationToken cancellationToken);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, decimal>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<decimal>

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Decimal>>

A projection function to apply to each element.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int64>>>)

Asynchronously computes the average of a sequence of nullable Int64 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<long>>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<int64>>> -> System.Threading.Tasks.Task<Nullable<double>>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Long)))) As Task(Of Nullable(Of Double))

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Int64>>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Single>>>)

Asynchronously computes the average of a sequence of nullable Single values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<float>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<float>>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<single>>> -> System.Threading.Tasks.Task<Nullable<single>>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Single)))) As Task(Of Nullable(Of Single))

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Single>>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Int32>>>)

Asynchronously computes the average of a sequence of nullable Int32 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<int>>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<int>>> -> System.Threading.Tasks.Task<Nullable<double>>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Integer)))) As Task(Of Nullable(Of Double))

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Int32>>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Double>>>)

Asynchronously computes the average of a sequence of nullable Double values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<double>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<double>>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<double>>> -> System.Threading.Tasks.Task<Nullable<double>>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Double)))) As Task(Of Nullable(Of Double))

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Double>>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Nullable<Decimal>>>)

Asynchronously computes the average of a sequence of nullable Decimal values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<Nullable<decimal>> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,Nullable<decimal>>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, Nullable<decimal>>> -> System.Threading.Tasks.Task<Nullable<decimal>>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Decimal)))) As Task(Of Nullable(Of Decimal))

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Nullable<Decimal>>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int64>>)

Asynchronously computes the average of a sequence of Int64 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<double> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,long>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, int64>> -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Long))) As Task(Of Double)

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Int64>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Int32>>)

Asynchronously computes the average of a sequence of Int32 values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<double> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,int>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, int>> -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Integer))) As Task(Of Double)

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Int32>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Double>>)

Asynchronously computes the average of a sequence of Double values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<double> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,double>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, double>> -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Double))) As Task(Of Double)

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Double>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Decimal>>)

Asynchronously computes the average of a sequence of Decimal values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<decimal> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,decimal>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, decimal>> -> System.Threading.Tasks.Task<decimal>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Decimal))) As Task(Of Decimal)

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Decimal>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource,Single>>)

Asynchronously computes the average of a sequence of Single values that is obtained by invoking a projection function on each element of the input sequence.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<float> AverageAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,float>> selector);
static member AverageAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, single>> -> System.Threading.Tasks.Task<single>
<Extension()>
Public Function AverageAsync(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Single))) As Task(Of Single)

Type Parameters

TSource

The type of the elements of source .

Parameters

source
IQueryable<TSource>

A sequence of values to calculate the average of.

selector
Expression<Func<TSource,Single>>

A projection function to apply to each element.

Returns

A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

Attributes

Exceptions

source or selector is null .

source contains no elements.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to