Linq-generation-operations
提供:Dev Guides
LINQでの生成操作
世代演算子によって新しい値のシーケンスが作成されます。
Operator | Description | C# Query Expression Syntax | VB Query Expression Syntax |
---|---|---|---|
DefaultIfEmpty | When applied to an empty sequence, generate a default element within a sequence | Not Applicable | Not Applicable |
Empty | Returns an empty sequence of values and is the most simplest generational operator | Not Applicable | Not Applicable |
Range | Generates a collection having a sequence of integers or numbers | Not Applicable | Not Applicable |
Repeat | Generates a sequence containing repeated values of a specific length | Not Applicable | Not Applicable |
DefaultIfEmptyの例-Enumerable.DefaultIfEmpty.Method
C#
VB
上記のC#またはVBのコードをコンパイルして実行すると、次の結果が生成されます-
範囲の例-Enumerable.Rangeメソッド
C#
VB
上記のC#またはVBのコードをコンパイルして実行すると、次の結果が生成されます-
Repeatの例-Enumerable.Repeat(Of TResult)メソッド
C#
VB
上記のC#またはVBのコードをコンパイルして実行すると、次の結果が生成されます-