EdmFunctions.Sum Method (DbExpression)

 

Creates a DbFunctionExpression that invokes the canonical 'Sum' function over the specified collection. The result type of the expression is the same as the element type of the collection.

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

public static DbFunctionExpression Sum(
	this DbExpression collection
)

Parameters

collection
Type: System.Data.Entity.Core.Common.CommandTrees.DbExpression

An expression that specifies the collection from which the sum should be computed.

Return Value

Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpression

A new DbFunctionExpression that produces the sum.

Exception Condition
ArgumentNullException

collection is null.

ArgumentException

No overload of the canonical 'Sum' function accepts an argument with the result type of collection.