title: How can I use linq to initialize an array of repeated elements?
body: <p>At present, I'm using something like this to build a list of 10 objects:</p>
  
  <pre><code>myList = (from _ in Enumerable.Range(0, 10) select new MyObject {...}).toList()
  </code></pre>
  
  <p>This is based off my python background, where I'd write:</p>
  
  <pre><code>myList = [MyObject(...) for _ in range(10)]
  </code></pre>
  
  <p>Note that I want my list to contain 10 instances of my object, not the same instance 10 times.</p>
  
  <p>Is this still a sensible way to do things in C#? Is there a cost to doing it this way over a simple for loop?</p>