Yes, it is possible:
Method Syntax:
foreach (var person in people.Where(n => n.sex == "male"))
{
}
Or the rather lengthy Query Syntax:
foreach (var person in from person in people where person.sex == "male" select person)
Yes, it is possible:
Method Syntax:
foreach (var person in people.Where(n => n.sex == "male"))
{
}
Or the rather lengthy Query Syntax:
foreach (var person in from person in people where person.sex == "male" select person)