I\'m trying to rewrite some old SQL into LINQ to SQL. I have a sproc with a GROUP BY WITH ROLLUP but I\'m not sure what the LINQ equivalent would be. LINQ has a GroupBy bu
Quite interesting solution is provided here
https://blogs.msdn.microsoft.com/mitsu/2007/12/21/playing-with-linq-grouping-groupbymany/
It describes how to perform groupbby by several properties. I.e:
var result = customers.GroupByMany(c => c.Country, c => c.City);
As result you would get hierarchical structure that can be simply converted to flat list.