共用方式為


DbExpressionBuilder.GroupBy 方法

定義

建立新的 DbGroupByExpression,它會根據指定的群組索引鍵分組輸入集項目,並套用指定的彙總。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbGroupByExpression ^ GroupBy(System::Data::Common::CommandTrees::DbGroupExpressionBinding ^ input, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Data::Common::CommandTrees::DbExpression ^>> ^ keys, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Data::Common::CommandTrees::DbAggregate ^>> ^ aggregates);
public static System.Data.Common.CommandTrees.DbGroupByExpression GroupBy (this System.Data.Common.CommandTrees.DbGroupExpressionBinding input, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,System.Data.Common.CommandTrees.DbExpression>> keys, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,System.Data.Common.CommandTrees.DbAggregate>> aggregates);
static member GroupBy : System.Data.Common.CommandTrees.DbGroupExpressionBinding * seq<System.Collections.Generic.KeyValuePair<string, System.Data.Common.CommandTrees.DbExpression>> * seq<System.Collections.Generic.KeyValuePair<string, System.Data.Common.CommandTrees.DbAggregate>> -> System.Data.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

參數

keys
IEnumerable<KeyValuePair<String,DbExpression>>

字串-運算式組的清單,用於定義分組的資料行。

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

指定要套用之彙總的運算式清單。

傳回

含有指定之輸入集、群組索引鍵和彙總的新 DbGroupByExpression。

例外狀況

inputkeysaggregates 為 null、 keys 包含 Null 數據行索引鍵或表示式,或 aggregates 包含 Null 匯總數據行名稱或匯總。

keysaggregates 都是空的,或是指定了無效或重複的資料行名稱。

備註

DbGroupByExpression 允許索引鍵清單或匯總清單是空的,但不能同時包含兩者。

適用於