DbExpressionBuilder.GroupBy Method (DbGroupExpressionBinding, IEnumerable<KeyValuePair<String, DbExpression>>, IEnumerable<KeyValuePair<String, DbAggregate>>)
Creates a new DbGroupByExpression that groups the elements of the input set according to the specified group keys and applies the given aggregates.
Assembly: EntityFramework (in EntityFramework.dll)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static DbGroupByExpression GroupBy( this DbGroupExpressionBinding input, IEnumerable<KeyValuePair<string, DbExpression>> keys, IEnumerable<KeyValuePair<string, DbAggregate>> aggregates )
Parameters
- input
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbGroupExpressionBinding
A DbGroupExpressionBinding that specifies the input set.
- keys
-
Type:
System.Collections.Generic.IEnumerable<KeyValuePair<String, DbExpression>>
A list of string-expression pairs that define the grouping columns.
- aggregates
-
Type:
System.Collections.Generic.IEnumerable<KeyValuePair<String, DbAggregate>>
A list of expressions that specify aggregates to apply.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbGroupByExpressionA new DbGroupByExpression with the specified input set, grouping keys and aggregates.
Exception | Condition |
---|---|
ArgumentNullException | input, keys or aggregates is null, keys contains a null key column name or expression, or aggregates contains a null aggregate column name or aggregate. |
ArgumentException | Both keys and aggregates are empty, or an invalid or duplicate column name was specified. |
DbGroupByExpression allows either the list of keys or the list of aggregates to be empty, but not both.