private static IEnumerable<Student> FirstNameBeforeLast(Student[] students) { IEnumerable<Student> result = from student in students where student.FirstName.CompareTo(student.LastName) < 0 select student; return result; }
private static IEnumerable<Student> FindPeopleAtCertainAge(Student[] students, int startAge, int endAge) { IEnumerable<Student> result = from student in students where student.Age >= startAge && student.Age <= endAge select student; return result; }