title: C# Yield return list, not single object
body: <p>I need batch wise sublist to process objects in batch. Parallel.ForEach is not feasible as the batch is posted to the HTTP request.</p>
  
  <pre><code>public IEnumerable&lt;T&gt; BatchProcess&lt;T&gt;(IEnumerable&lt;T&gt; list, int batchSize)
      {
          int page = 0;
          IEnumerable&lt;T&gt; batch;
          while ((batch = list.Skip(page).Take(batchSize)).Count() != 0)
          {
              page++;
              yield return batch; //Error CS0029  Cannot implicitly convert type 'System.Collections.Generic.List&lt;T&gt;' to 'T'
          }
  
      }
  </code></pre>
  
  <p>Error   CS0029  Cannot implicitly convert type 'System.Collections.Generic.List' to 'T'.</p>
  
  <p>Expecting "yeild return" to return a list of objects instead of returning a single object.</p>