DevForce Help Reference
Average<TSource>(IEntityScalarQuery<TSource>) Method
Example 


Computes the average of a sequence of numeric values.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function Average(Of TSource)( _
   ByVal source As IEntityScalarQuery(Of TSource) _
) As Task(Of TSource)
'Usage
 
Dim source As IEntityScalarQuery(Of TSource)
Dim value As Task(Of TSource)
 
value = EntityScalarAsyncExtensions.Average(Of TSource)(source)

Parameters

source

Type Parameters

TSource
Example
public async void AsyncAverage() {
  var avgFreight = await _entityManager.OrderSummaries.Select(o => o.Freight).AsScalarAsync().Average();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityScalarAsyncExtensions Class
EntityScalarAsyncExtensions Members
Overload List

Send Feedback