语言

DbExpressionBuilder.GroupBy 方法

定义

创建一个新 DbGroupByExpression 项,以便根据指定的组键对输入集的元素进行分组,并应用给定的聚合。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Data.Entity.Core.Common.CommandTrees.DbGroupByExpression GroupBy(this System.Data.Entity.Core.Common.CommandTrees.DbGroupExpressionBinding input, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,System.Data.Entity.Core.Common.CommandTrees.DbExpression>> keys, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,System.Data.Entity.Core.Common.CommandTrees.DbAggregate>> aggregates);
static member GroupBy : System.Data.Entity.Core.Common.CommandTrees.DbGroupExpressionBinding * seq<System.Collections.Generic.KeyValuePair<string, System.Data.Entity.Core.Common.CommandTrees.DbExpression>> * seq<System.Collections.Generic.KeyValuePair<string, System.Data.Entity.Core.Common.CommandTrees.DbAggregate>> -> System.Data.Entity.Core.Common.CommandTrees.DbGroupByExpression
<Extension()>
Public Function GroupBy (input As DbGroupExpressionBinding, keys As IEnumerable(Of KeyValuePair(Of String, DbExpression)), aggregates As IEnumerable(Of KeyValuePair(Of String, DbAggregate))) As DbGroupByExpression

参数

input
DbGroupExpressionBinding

指定输入集的 A DbGroupExpressionBinding 。

keys
IEnumerable<KeyValuePair<String,DbExpression>>

定义分组列的字符串表达式对的列表。

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

指定要应用的聚合的表达式列表。

返回

具有指定输入集、分组键和聚合的新 DbGroupByExpression。

特性

例外

输入、键或聚合为 null、键包含 null 列键或表达式,或聚合包含 null 聚合列名称或聚合。

键和聚合均为空,或者指定了无效或重复的列名。

适用于