DbExpressionBuilder.GroupBy Metoda

Definicja

Tworzy nowy DbGroupByExpression element, który grupuje elementy zestawu danych wejściowych zgodnie z określonymi kluczami grupy i stosuje podane agregacje.

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

Parametry

input
DbGroupExpressionBinding

Element DbGroupExpressionBinding określający zestaw danych wejściowych.

keys
IEnumerable<KeyValuePair<String,DbExpression>>

Lista par ciąg-wyrażenie, które definiują kolumny grupowania.

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

Lista wyrażeń, które określają agregacje do zastosowania.

Zwraca

Nowa grupa DbGroupByExpression z określonym zestawem danych wejściowych, grupowanie kluczy i agregacji.

Wyjątki

input, keys lub aggregates ma wartość null, keys zawiera klucz kolumny null lub wyrażenie albo aggregates zawiera nazwę kolumny agregującej null lub agregację.

Obie keys wartości i aggregates są puste lub określono nieprawidłową lub zduplikowaną nazwę kolumny.

Uwagi

Funkcja DbGroupByExpression umożliwia, aby lista kluczy lub lista agregacji była pusta, ale nie obie.

Dotyczy