To

public static IEnumerable<int> To(this int first, int last) {
  return Enumerable.Range(first, last - first + 1);
}
Example:
var numbers = 1.To(10);

Description

Creates a range of integers as an IEnumerable<Int32>.

Details

Double click on the code to select all.

 

;