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

Параметры

input
DbGroupExpressionBinding

Значение, DbGroupExpressionBinding указывающее входной набор.

keys
IEnumerable<KeyValuePair<String,DbExpression>>

Список пар строковых выражений, определяющих столбцы группировки.

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

Список выражений, которые указывают агрегаты для применения.

Возвращаемое значение

Новый dbGroupByExpression с указанным входным набором, группированием ключей и агрегатами.

Исключения

input keys значение aggregates NULL, keys содержит ключ столбца null или выражение или aggregates содержит имя или агрегат столбца null.

Оба keys значения aggregates являются пустыми, или указано недопустимое или повторяющееся имя столбца.

Комментарии

DbGroupByExpression позволяет либо списку ключей, либо списку агрегатов быть пустым, но не обоим.

Применяется к