class SomeObject
{
int Value { get; set; }
string ID { get; set; }
}
var TheList = List<SomeObject> { ... }
var groupedObjects = TheList.GroupBy(o => o.ID);
The return type is IEnumerable<IGrouping<SomeObject, string, SomeObject>>
In the Debug "Results View" the Items are grouped correctly.
How can I get List<List<SomeObject>>
as return?
A simple ToList()
does obviously not work.