System.Linq.Queryable.Average Method

Computes the average of a sequence of nullable float values.

Syntax

public static Nullable<float> Average (this IQueryable<Nullable<float>> source)

Parameters

source
A sequence of nullable float values to calculate the average of.

Returns

The average of the sequence of values, or null if the source sequence is empty or contains only null values.

Remarks

The Queryable.Average(IQueryable<Nullable<float>>) method generates a System.Linq.Expressions.MethodCallExpression that represents calling Queryable.Average(IQueryable<Nullable<float>>) itself. It then passes the System.Linq.Expressions.MethodCallExpression to the IQueryProvider.Execute``1(System.Linq.Expressions.Expression) method of the System.Linq.IQueryProvider represented by the IQueryable.Provider property of the source parameter.

The query behavior that occurs as a result of executing an expression tree that represents calling Queryable.Average(IQueryable<Nullable<float>>) depends on the implementation of the type of the source parameter. The expected behavior is that it calculates the average of the values in source.

Requirements

Namespace: System.Linq
Assembly: System.Core (in System.Core.dll)
Assembly Versions: 3.5.0.0, 4.0.0.0