DbExpressionBuilder.GroupBy Metodo

Definizione

Crea un nuovo oggetto DbGroupByExpression 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 stringa/espressione che definiscono le colonne di raggruppamento.

aggregates
IEnumerable<KeyValuePair<String,DbAggregate>>

Elenco di espressioni che specificano le aggregazioni da applicare.

Restituisce

Nuovo DbGroupByExpression con il set di input specificato, le chiavi di raggruppamento e gli aggregati.

Eccezioni

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

Sia keys sia aggregates sono vuoti o è stato specificato un nome della 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