title: Is there an elegant way to repeat an action?
body: <p>In C#, using .NET Framework 4, is there an elegant way to repeat the same action a determined number of times? For example, instead of:</p>
  
  <pre><code>int repeat = 10;
  for (int i = 0; i &lt; repeat; i++)
  {
      Console.WriteLine("Hello World.");
      this.DoSomeStuff();
  }
  </code></pre>
  
  <p>I would like to write something like:</p>
  
  <pre><code>Action toRepeat = () =&gt;
  {
      Console.WriteLine("Hello World.");
      this.DoSomeStuff();
  };
  
  toRepeat.Repeat(10);
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>Enumerable.Repeat(10, () =&gt;
  {
      Console.WriteLine("Hello World.");
      this.DoSomeStuff();
  });
  </code></pre>
  
  <p>I know I can create my own extension method for the first example, but isn't there an existent feature which makes it already possible to do this?</p>