コード例 #1
0
        private static IEnumerable<Students> YoungStudents(Students[] collection, int startAge, int endAge)
        {
            var sorted = collection.Where(st => st.Age >= startAge && st.Age <= endAge);

            return sorted;
        }
コード例 #2
0
        private static IEnumerable<Students> FirstNameBeforeLast(Students[] collection)
        {
            var sorted = collection.OrderBy(x => x.FirstName.CompareTo(x.LastName) < 0);

            return sorted;
        }