CosmosLinqExtensions.AverageAsync Method

Definition

Overloads

AverageAsync(IQueryable<Decimal>, CancellationToken)

Computes the average of a sequence of System.Decimal values.

AverageAsync(IQueryable<Double>, CancellationToken)

Computes the average of a sequence of System.Double values.

AverageAsync(IQueryable<Int32>, CancellationToken)

Computes the average of a sequence of System.Int32 values.

AverageAsync(IQueryable<Int64>, CancellationToken)

Computes the average of a sequence of System.Int64 values.

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

Computes the average of a sequence of System.Nullable`1 values.

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

Computes the average of a sequence of System.Nullable`1 values.

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

Computes the average of a sequence of System.Nullable`1 values.

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

Computes the average of a sequence of System.Nullable`1 values.

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

Computes the average of a sequence of System.Nullable`1 values.

AverageAsync(IQueryable<Single>, CancellationToken)

Computes the average of a sequence of System.Single values.

AverageAsync(IQueryable<Decimal>, CancellationToken)

Computes the average of a sequence of System.Decimal values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<decimal>> AverageAsync (this System.Linq.IQueryable<decimal> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<decimal> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<decimal>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Decimal), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Decimal))

Parameters

source
System.Linq.IQueryable<System.Decimal>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Decimal>>

The average value in the sequence.

Applies to

AverageAsync(IQueryable<Double>, CancellationToken)

Computes the average of a sequence of System.Double values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double>> AverageAsync (this System.Linq.IQueryable<double> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<double> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Double), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Double))

Parameters

source
System.Linq.IQueryable<System.Double>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Double>>

The average value in the sequence.

Applies to

AverageAsync(IQueryable<Int32>, CancellationToken)

Computes the average of a sequence of System.Int32 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double>> AverageAsync (this System.Linq.IQueryable<int> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Integer), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Double))

Parameters

source
System.Linq.IQueryable<System.Int32>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Double>>

The average value in the sequence.

Applies to

AverageAsync(IQueryable<Int64>, CancellationToken)

Computes the average of a sequence of System.Int64 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double>> AverageAsync (this System.Linq.IQueryable<long> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Long), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Double))

Parameters

source
System.Linq.IQueryable<System.Int64>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Double>>

The average value in the sequence.

Applies to

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

Computes the average of a sequence of System.Nullable`1 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<decimal?>> AverageAsync (this System.Linq.IQueryable<decimal?> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<Nullable<decimal>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<Nullable<decimal>>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Decimal)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Nullable(Of Decimal)))

Parameters

source
System.Linq.IQueryable<System.Nullable<System.Decimal>>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Nullable<System.Decimal>>>

The average value in the sequence.

Applies to

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

Computes the average of a sequence of System.Nullable`1 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double?>> AverageAsync (this System.Linq.IQueryable<double?> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<Nullable<double>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<Nullable<double>>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Double)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Nullable(Of Double)))

Parameters

source
System.Linq.IQueryable<System.Nullable<System.Double>>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Nullable<System.Double>>>

The average value in the sequence.

Applies to

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

Computes the average of a sequence of System.Nullable`1 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double?>> AverageAsync (this System.Linq.IQueryable<int?> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<Nullable<int>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<Nullable<double>>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Integer)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Nullable(Of Double)))

Parameters

source
System.Linq.IQueryable<System.Nullable<System.Int32>>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Nullable<System.Double>>>

The average value in the sequence.

Applies to

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

Computes the average of a sequence of System.Nullable`1 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<double?>> AverageAsync (this System.Linq.IQueryable<long?> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<Nullable<int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<Nullable<double>>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Long)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Nullable(Of Double)))

Parameters

source
System.Linq.IQueryable<System.Nullable<System.Int64>>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Nullable<System.Double>>>

The average value in the sequence.

Applies to

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

Computes the average of a sequence of System.Nullable`1 values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<float?>> AverageAsync (this System.Linq.IQueryable<float?> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<Nullable<single>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<Nullable<single>>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Single)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Nullable(Of Single)))

Parameters

source
System.Linq.IQueryable<System.Nullable<System.Single>>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Nullable<System.Single>>>

The average value in the sequence.

Applies to

AverageAsync(IQueryable<Single>, CancellationToken)

Computes the average of a sequence of System.Single values.

public static System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<float>> AverageAsync (this System.Linq.IQueryable<float> source, System.Threading.CancellationToken cancellationToken = default);
static member AverageAsync : System.Linq.IQueryable<single> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.Response<single>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Single), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Single))

Parameters

source
System.Linq.IQueryable<System.Single>

A sequence of values to calculate the average of.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Response<System.Single>>

The average value in the sequence.

Applies to