語言

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,包含指定的輸入集合、分組鍵與聚合。

屬性

例外狀況

輸入、鍵或聚合為空,鍵包含空欄鍵或表達式,或聚合包含空聚合欄名稱或聚合。

鍵與聚合皆為空,或欄位名稱無效或重複。

適用於