Linq-projection-operations
提供:Dev Guides
LINQの投影操作
投影とは、オブジェクトを特定のプロパティのみを持つまったく新しいフォームに変換する操作です。
Operator | Description | C# Query Expression Syntax | VB Query Expression Syntax |
---|---|---|---|
Select | The operator projects values on basis of a transform function | select | Select |
SelectMany | The operator project the sequences of values which are based on a transform function as well as flattens them into a single sequence | Use multiple from clauses | Use multiple From clauses |
選択の例-クエリ式
C#
VB
C#またはVBの上記のコードがコンパイルされて実行されると、次の結果が生成されます-
SelectManyの例-クエリ式
C#
VB
C#またはVBの上記のコードがコンパイルされて実行されると、次の結果が生成されます-