Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public IList<PersonAgeGroup> GroupPersonsByAge(List<Person> persons)
  2. {
  3. //throw new NotImplementedException();
  4. var twentiers = persons.GroupBy(p => p.Age == 20);
  5. var thirtiers = persons.GroupBy(p => p.Age == 30);
  6. List<PersonAgeGroup> personAgeGroups = new List<PersonAgeGroup>;
  7. personAgeGroups[0].Age = 20;
  8. personAgeGroups[0].Persons = twentiers;
  9. personAgeGroups[1].Age = 30;
  10. personAgeGroups[1].Persons = thirtiers;
  11.  
  12. return personAgeGroups;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement