DbExpressionBuilder.GroupBy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建一个新的 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
指定输入集的 DbGroupExpressionBinding。
定义分组列的字符串表达式对列表。
- aggregates
- IEnumerable<KeyValuePair<String,DbAggregate>>
指定要应用的聚合方法的表达式列表。
返回
使用指定输入集、分组密钥和聚合的新 DbGroupByExpression。
- 属性
例外
输入、键或聚合为 null,键包含 null 列键或表达式,或者聚合包含 null 聚合列名称或聚合。
键和聚合都是空的,或者指定的列名无效或重复。