DbExpressionBuilder.GroupBy 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立一個新資料 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
參數
- input
- DbGroupExpressionBinding
A DbGroupExpressionBinding 指定輸入集合。
一串定義分組欄位的字串表達式對。
- aggregates
- IEnumerable<KeyValuePair<String,DbAggregate>>
一份指定要應用的聚合函式清單。
傳回
一個新的 DbGroupByExpression,包含指定的輸入集合、分組鍵與聚合。
例外狀況
input, keys 或 aggregates 為空, keys 包含空欄位鍵或表達式,或 aggregates 包含空集合欄位名稱或彙總。
和 aggregates 皆keys為空,或指定欄位名稱無效或重複。
備註
DbGroupByExpression 允許鍵列表或聚合列表為空,但不能兩者同時為空。