简单:
var consolidatedChildren = from c in children group c by new { c.School, c.Friend, c.FavoriteColor, } into gcs select new ConsolidatedChild() { School = gcs.Key.School, Friend = gcs.Key.Friend, FavoriteColor = gcs.Key.FavoriteColor, Children = gcs.ToList(), };var consolidatedChildren = children .GroupBy(c => new { c.School, c.Friend, c.FavoriteColor, }) .Select(gcs => new ConsolidatedChild() { School = gcs.Key.School, Friend = gcs.Key.Friend, FavoriteColor = gcs.Key.FavoriteColor, Children = gcs.ToList(), });

![C#Linq Group By在多个列上[重复] C#Linq Group By在多个列上[重复]](http://www.mshxw.com/aiimages/31/452061.png)
