title: How to chunk dictionary by Linq in C#?
body: <p>I have a dictionary, which i need to chunk to list of 9 dictionary item in a group and other 9 items in to next group and so on...,</p>
  
  <p>Tried this code,</p>
  
  <pre><code>    public static List&lt;List&lt;DictionaryEntry&gt;&gt; ChunkDict(Dictionary&lt;string,string&gt; theList, int chunkSize) 
      { 
          List&lt;List&lt;DictionaryEntry&gt;&gt; result = theList.Select((x, i) =&gt; 
              new { data = x, indexgroup = i / chunkSize })
              .GroupBy(x =&gt; x.indexgroup, x =&gt; x.data)
              .Select(g =&gt; new List&lt;DictionaryEntry&gt;(g)).ToList(); 
          return result; 
      } 
  </code></pre>
  
  <p>But it is not compiling, got error: Error   398 The best overloaded method match for 'System.Collections.Generic.List.List(System.Collections.Generic.IEnumerable)' has some invalid arguments  </p>
  
  <p>How do i do this?</p>