Say, I have an array of lists, and I want to get a count of all of the items in all of the lists. How would I calculate the count with LINQ? (just general curiosity here)
Here's the old way to do it:
List<item>[] Lists = // (init the array of lists)
int count = 0;
foreach(List<item> list in Lists)
count+= list.Count;
return count;
How would you LINQify that? (c# syntax, please)