title: Is it possible to use Linq to get a total count of items in a list of lists?
body: <p>We have a simple structure which is just a list of lists, like so...</p>
  
  <pre><code>var fooInfo = new List&lt;List&lt;Foo&gt;&gt;();
  </code></pre>
  
  <p>I'm wondering if there's a simple way we can use linq to return the total of all items from the inner lists.  For example, if we had this...</p>
  
  <pre><code>fooInfo.add(new List&lt;Foo&gt;()); // First list within the outer list
  fooInfo.add(new List&lt;Foo&gt;()); // Second list within the outer list
  fooInfo.add(new List&lt;Foo&gt;()); // Third list within the outer list
  
  // Add two items to the first inner list
  fooInfo[0].add(new Foo());
  fooInfo[0].add(new Foo());
  
  // Add one item to the second inner list
  fooInfo[1].add(new Foo());
  
  // Add four items to the third inner list
  fooInfo[2].add(new Foo());
  fooInfo[2].add(new Foo());
  fooInfo[2].add(new Foo());
  fooInfo[2].add(new Foo());
  </code></pre>
  
  <p>...we would have three lists with two, one and four items respectively, meaning the total 'Foo' objects are seven.  That's the number I'm hoping to retrieve via linq rather than having to write our own looping code and manually tally them up.</p>
  
  <p>e.g.</p>
  
  <pre><code>var totalFoos = fooInfo.LINQToGetTotalFoos();
  </code></pre>
  
  <p>rather than....</p>
  
  <pre><code>int totalFoos = 0;
  
  foreach(var childList in fooInfo)
      totalFoos += childList.Count();
  </code></pre>