DocumentQueryable.AverageAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AverageAsync(IQueryable<Decimal>, CancellationToken)
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 = default);
static member AverageAsync : System.Linq.IQueryable<decimal> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<decimal>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Decimal), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Decimal)
Parameters
- source
- IQueryable<Decimal>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Double>, CancellationToken)
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 = default);
static member AverageAsync : System.Linq.IQueryable<double> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Double), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Double)
Parameters
- source
- IQueryable<Double>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Int32>, CancellationToken)
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 = default);
static member AverageAsync : System.Linq.IQueryable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Integer), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Double)
Parameters
- source
- IQueryable<Int32>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Int64>, CancellationToken)
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 = default);
static member AverageAsync : System.Linq.IQueryable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<double>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Long), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Double)
Parameters
- source
- IQueryable<Int64>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Nullable<Decimal>>, CancellationToken)
Computes the average of a sequence of Nullable<T> values.
public static System.Threading.Tasks.Task<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<Nullable<decimal>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Decimal)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of Decimal))
Parameters
- source
- IQueryable<Nullable<Decimal>>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Nullable<Double>>, CancellationToken)
Computes the average of a sequence of Nullable<T> values.
public static System.Threading.Tasks.Task<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<Nullable<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Double)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of Double))
Parameters
- source
- IQueryable<Nullable<Double>>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Nullable<Int32>>, CancellationToken)
Computes the average of a sequence of Nullable<T> values.
public static System.Threading.Tasks.Task<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<Nullable<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Integer)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of Double))
Parameters
- source
- IQueryable<Nullable<Int32>>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Nullable<Int64>>, CancellationToken)
Computes the average of a sequence of Nullable<T> values.
public static System.Threading.Tasks.Task<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<Nullable<double>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Long)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of Double))
Parameters
- source
- IQueryable<Nullable<Int64>>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Nullable<Single>>, CancellationToken)
Computes the average of a sequence of Nullable<T> values.
public static System.Threading.Tasks.Task<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<Nullable<single>>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Nullable(Of Single)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of Single))
Parameters
- source
- IQueryable<Nullable<Single>>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
AverageAsync(IQueryable<Single>, CancellationToken)
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 = default);
static member AverageAsync : System.Linq.IQueryable<single> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<single>
<Extension()>
Public Function AverageAsync (source As IQueryable(Of Single), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Single)
Parameters
- source
- IQueryable<Single>
A sequence of values to calculate the average of.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
The average value in the sequence.
Applies to
Azure SDK for .NET