DbExpressionBuilder.GroupBy Metodo

Definizione

Crea un nuovo DbGroupByExpression oggetto che raggruppa gli elementi del set di input in base alle chiavi di gruppo specificate e applica le aggregazioni specificate.

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

Parametri

input
DbGroupExpressionBinding

Oggetto DbGroupExpressionBinding che specifica il set di input.

keys
IEnumerable<KeyValuePair<String,DbExpression>>

Elenco di coppie di espressioni di stringa che definiscono le colonne di raggruppamento.

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

Elenco di espressioni che specificano le aggregazioni da applicare.

Valori restituiti

Nuovo DbGroupByExpression con il set di input specificato, raggruppando chiavi e aggregazioni.

Eccezioni

inputo keysaggregates è Null, keys contiene una chiave o un'espressione di colonna Null oppure aggregates contiene un nome o un'aggregazione di colonna di aggregazione Null.

Sia keys che aggregates sono vuoti oppure è stato specificato un nome di colonna non valido o duplicato.

Commenti

DbGroupByExpression consente che l'elenco di chiavi o l'elenco di aggregazioni sia vuoto, ma non entrambi.

Si applica a