Linq-grouping-operators
提供:Dev Guides
LINQでの演算子のグループ化
オペレーターは、共通の共有属性に基づいていくつかのグループにデータを入れます。
Operator | Description | C# Query Expression Syntax | VB Query Expression Syntax |
---|---|---|---|
GroupBy | Organize a sequence of items in groups and return them as an IEnumerable collection of type IGrouping<key, element> | group … by -or- group … by … into … | Group … By … Into … |
ToLookup | Execute a grouping operation in which a sequence of key pairs are returned | Not Applicable | Not Applicable |
GroupByの例-クエリ式
C#
VB
C#またはVBの上記のコードがコンパイルされて実行されると、次の結果が生成されます-