Get the first and second objects from a list using LINQ
- by Vahid
I have a list of Person objects. How can I get the first and second Person objects that meet a certain criteria from List<Person> People using LINQ?
Let's say here is the list I've got. How can I get the first and second persons that are over 18 that is James and Jodie.
public class Person
{
public string Name;
public int age;
}
…