title: Is there any way to repeat a Func<T, T> with Enumerable.Repeat method in C#?
body: <p>I wrote a function that accepts (Func &amp; int N) and repeats the Func N times and returns a result.</p>
  
  <pre><code>public IEnumerable&lt;T&gt; MyFunction(Func&lt;T, T&gt; function, int iteration)
  {
  
  }
  </code></pre>
  
  <p>Is there any way to repeat a function using Enumerable.Repeat?</p>
  
  <pre><code>public IEnumerable&lt;T&gt; MyFunction(Func&lt;T, T&gt; function, int iteration)
  {
      yield return Enumerable.Repeat&lt;T&gt;(function.Invoke(), iteration);
  }
  </code></pre>
  
  <p>I tried to run the code above, but the function runs once.</p>