class PeopleDTO
{
string Name { get; set; }
List<AwardDTO> Awards { get; set; }
}
class AwardDTO
{
int AwardID {get; set; }
string AwardName {get; set; }
}
I am trying to use LINQ to filter my People Object for anyone who has an 'AwardID' equal to 5. I've tried the following but I'm not getting it:
List<PeopleDTO> people = GetPeople();
var test = (from p in people.Where(a => a.Awards.Where(a => a.AwardID == 5)) select p).ToList();
Any suggestions?