AggregateDistinct Method

DbExpressionBuilder.AggregateDistinct Method (EdmFunction, DbExpression)

.NET Framework (current version)

Creates a new DbFunctionAggregate that is applied in a distinct fashion.

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

public static DbFunctionAggregate AggregateDistinct(
	this EdmFunction function,
	DbExpression argument


Type: System.Data.Metadata.Edm.EdmFunction

The function that defines the aggregate operation.

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 true.

Exception Condition

function or argument is null.


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
Available since 4.5
Return to top
© 2016 Microsoft