LINQ Generation Operations

In LINQ, generation operations are used to create new sequence of elements. In LINQ we have different type of generation operator methods available those are

 

  • DefaultIfEmpty
  • Range
  • Repeat
  • Empty

These LINQ generation operators will help us to generate new sequence of elements.

 

Following table shows more detailed information related to generation operator methods.

 

MethodDescription
DefaultIfEmpty In case if collection contains empty elements then it will return default value
Empty It returns empty collection sequence
Range It returns a collection that contains a sequence of numbers.
Repeat It returns a collection that contains one repeated value based on specified length.

In next chapters we will study these LINQ generation operations in detail with example.