Use Multiple Column Group by in LINQ

  1. var myvalue=    
  2. from c in children    
  3. group c by new    
  4. {    
  5.     c.School,    
  6.     c.Friend,    
  7.     c.FavoriteColor,    
  8. } into gcs    
  9. select new ConsolidatedChild()    
  10. {    
  11.     School = gcs.Key.School,    
  12.     Friend = gcs.Key.Friend,    
  13.     FavoriteColor = gcs.Key.FavoriteColor,    
  14.     Children = gcs.ToList(),    
  15. };