DbExpressionBuilder.AggregateDistinct Method (EdmFunction, DbExpression)
Creates a new DbFunctionAggregate that is applied in a distinct fashion.
Assembly: EntityFramework (in EntityFramework.dll)
public static DbFunctionAggregate AggregateDistinct( this EdmFunction function, DbExpression argument )
Parameters
- function
-
Type:
System.Data.Entity.Core.Metadata.Edm.EdmFunction
The function that defines the aggregate operation.
- argument
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
The argument over which the aggregate function should be calculated.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionAggregateA 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 |
---|---|
ArgumentNullException | function or argument is null. |
ArgumentException | The 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. |