Yield return a bunch of elements
<p>I have a method that returns a list of <code>MyClass</code>. Within that method I split a list of <code>MyClass</code> into smaller chunks of let´s say 500 elements. Now I wonder if this is possible together with a <code>yield</code>-statement. Currently I have this code. However I´m curious if there is a way to yield return the whole bunch without this messy second inner loop. </p>

<pre><code>IEnumerable&lt;MyClass&gt; DoSomething() 
{
    List&lt;MyClass&gt; myList = ...
    foreach(var chunk in myList.Chunk(500))  // split the list in smaller lists
    {
        foreach(MyClass m in chunk) yield return m;
    }
}
</code></pre>

<p>Of course this works, but I wonder if I can also use the <code>yield</code> to return the whole bunch deferredly.</p>