Let\'s suppose if we have a class like:
class Person { internal int PersonID; internal string car; }
I have a list of this class
First, set your key field. Then include your other fields:
var results = persons .GroupBy(n => n.PersonId) .Select(r => new Result {PersonID = r.Key, Cars = r.ToList() }) .ToList()