Szerkesztés

Megosztás a következőn keresztül:


DbExpressionBuilder.GroupBy Method

Definition

Creates a new DbGroupByExpression that groups the elements of the input set according to the specified group keys and applies the given aggregates.

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

Parameters

input
DbGroupExpressionBinding

A DbGroupExpressionBinding that specifies the input set.

keys
IEnumerable<KeyValuePair<String,DbExpression>>

A list of string-expression pairs that define the grouping columns.

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

A list of expressions that specify aggregates to apply.

Returns

A new DbGroupByExpression with the specified input set, grouping keys and aggregates.

Exceptions

input, keys or aggregates is null, keys contains a null column key or expression, or aggregates contains a null aggregate column name or aggregate.

Both keys and aggregates are empty, or an invalid or duplicate column name was specified.

Remarks

DbGroupByExpression allows either the list of keys or the list of aggregates to be empty, but not both.

Applies to