Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

QueryableExtensions::AverageAsync Method

Entity Framework 6.0
 

Asynchronously computes the average of a sequence of Decimal values.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Decimal>^)

Asynchronously computes the average of a sequence of Decimal values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Decimal>^, CancellationToken)

Asynchronously computes the average of a sequence of Decimal values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Double>^)

Asynchronously computes the average of a sequence of Double values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Double>^, CancellationToken)

Asynchronously computes the average of a sequence of Double values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Int32>^)

Asynchronously computes the average of a sequence of Int32 values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Int32>^, CancellationToken)

Asynchronously computes the average of a sequence of Int32 values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Int64>^)

Asynchronously computes the average of a sequence of Int64 values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Int64>^, CancellationToken)

Asynchronously computes the average of a sequence of Int64 values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Decimal>>^)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Decimal>>^, CancellationToken)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Double>>^)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Double>>^, CancellationToken)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Int32>>^)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Int32>>^, CancellationToken)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Int64>>^)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Int64>>^, CancellationToken)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Single>>^)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Nullable<Single>>^, CancellationToken)

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

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Single>^)

Asynchronously computes the average of a sequence of Single values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync(IQueryable<Single>^, CancellationToken)

Asynchronously computes the average of a sequence of Single values.

System_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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_CAPS_pubmethodSystem_CAPS_staticAverageAsync<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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Decimal>^)

Asynchronously computes the average of a sequence of Decimal values.

public:
[ExtensionAttribute]
static Task<Decimal>^ AverageAsync(
	IQueryable<Decimal>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Decimal>^

A sequence of Decimal values to calculate the average of.

Return Value

Type: System.Threading.Tasks::Task<Decimal>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Decimal>^, CancellationToken)

Asynchronously computes the average of a sequence of Decimal values.

public:
[ExtensionAttribute]
static Task<Decimal>^ AverageAsync(
	IQueryable<Decimal>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Decimal>^

A sequence of Decimal values to calculate the average of.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Decimal>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Double>^)

Asynchronously computes the average of a sequence of Double values.

public:
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<double>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Double>^

A sequence of Double values to calculate the average of.

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Double>^, CancellationToken)

Asynchronously computes the average of a sequence of Double values.

public:
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<double>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Double>^

A sequence of Double values to calculate the average of.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Int32>^)

Asynchronously computes the average of a sequence of Int32 values.

public:
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<int>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Int32>^

A sequence of Int32 values to calculate the average of.

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Int32>^, CancellationToken)

Asynchronously computes the average of a sequence of Int32 values.

public:
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<int>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Int32>^

A sequence of Int32 values to calculate the average of.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Int64>^)

Asynchronously computes the average of a sequence of Int64 values.

public:
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<long long>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Int64>^

A sequence of Int64 values to calculate the average of.

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Int64>^, CancellationToken)

Asynchronously computes the average of a sequence of Int64 values.

public:
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<long long>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Int64>^

A sequence of Int64 values to calculate the average of.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Decimal>>^)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<Decimal>>^ AverageAsync(
	IQueryable<Nullable<Decimal>>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Decimal>>^

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Decimal>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Decimal>>^, CancellationToken)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<Decimal>>^ AverageAsync(
	IQueryable<Nullable<Decimal>>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Decimal>>^

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

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Decimal>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Double>>^)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<Nullable<double>>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Double>>^

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Double>>^, CancellationToken)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<Nullable<double>>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Double>>^

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

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Int32>>^)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<Nullable<int>>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Int32>>^

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Int32>>^, CancellationToken)

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

public:
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<Nullable<int>>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Int32>>^

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

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Int64>>^)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<Nullable<long long>>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Int64>>^

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Int64>>^, CancellationToken)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<Nullable<long long>>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Int64>>^

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

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Single>>^)

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

public:
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<float>>^ AverageAsync(
	IQueryable<Nullable<float>>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Single>>^

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Single>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Nullable<Single>>^, CancellationToken)

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

public:
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<float>>^ AverageAsync(
	IQueryable<Nullable<float>>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Nullable<Single>>^

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

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Single>>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Single>^)

Asynchronously computes the average of a sequence of Single values.

public:
[ExtensionAttribute]
static Task<float>^ AverageAsync(
	IQueryable<float>^ source
)

Parameters

source
Type: System.Linq::IQueryable<Single>^

A sequence of Single values to calculate the average of.

Return Value

Type: System.Threading.Tasks::Task<Single>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync Method (IQueryable<Single>^, CancellationToken)

Asynchronously computes the average of a sequence of Single values.

public:
[ExtensionAttribute]
static Task<float>^ AverageAsync(
	IQueryable<float>^ source,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<Single>^

A sequence of Single values to calculate the average of.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Single>^

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

Exception Condition
ArgumentNullException

source is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Decimal>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Decimal>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Decimal>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Decimal>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Decimal>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Decimal>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Decimal>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Decimal>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, double>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Double>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<double>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, double>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Double>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, int>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Int32>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<double>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, int>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Int32>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<double>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, long long>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Int64>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
static Task<double>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, long long>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Int64>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Double>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<Decimal>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<Decimal>>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Decimal>>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Nullable<Decimal>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<Decimal>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<Decimal>>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Decimal>>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Decimal>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<double>>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Double>>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<double>>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Double>>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<int>>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Int32>>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[ExtensionAttribute]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<int>>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Int32>>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<long long>>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Int64>>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<double>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<long long>>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Int64>>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Double>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Nullable<float>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<float>>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Single>>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Nullable<Single>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Nullable<float>>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, Nullable<float>>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Nullable<Single>>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Nullable<Single>>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<float>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, float>^>^ selector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Single>^>^

A projection function to apply to each element.

Return Value

Type: System.Threading.Tasks::Task<Single>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top

QueryableExtensions::AverageAsync<TSource> Method (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.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<float>^ AverageAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, float>^>^ selector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

A sequence of values to calculate the average of.

selector
Type: System.Linq.Expressions::Expression<Func<TSource, Single>^>^

A projection function to apply to each element.

cancellationToken
Type: System.Threading::CancellationToken

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

Return Value

Type: System.Threading.Tasks::Task<Single>^

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

Type Parameters

TSource

The type of the elements of source .

Exception Condition
ArgumentNullException

source or selector is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

InvalidOperationException

source contains no elements.

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.

Return to top
Show: