Export (0) Print
Expand All
Expand Minimize

DbExpressionBuilder.Aggregate Method

.NET Framework 4.6 and 4.5

Creates a new DbFunctionAggregate.

Namespace:  System.Data.Common.CommandTrees.ExpressionBuilder
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public static DbFunctionAggregate Aggregate(
	this EdmFunction function,
	DbExpression argument
)

Parameters

function
Type: System.Data.Metadata.Edm.EdmFunction

The function that defines the aggregate operation.

argument
Type: System.Data.Common.CommandTrees.DbExpression

The argument over which the aggregate function should be calculated.

Return Value

Type: System.Data.Common.CommandTrees.DbFunctionAggregate
A new function aggregate with a reference to the given function and argument. The function aggregate's Distinct property will have the value false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type EdmFunction. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

ExceptionCondition
ArgumentNullException

function or argument null.

ArgumentException

function is not an aggregate function or has more than one argument, or the result type of argument is not equal or promotable to the parameter type of function.

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft