예제 #1
0
        public static List <Student> CheckCriteriaName(List <Student> students, IStudent s)
        {
            List <Student> filterStudent = new List <Student>();

            foreach (var student in students)
            {
                // change the object behaviour
                // invoking the delegate ageLess21()
                // successfully modified my internal function method
                if (s.CheckCriteria(student))
                {
                    filterStudent.Add(student);
                }
            }

            return(filterStudent);
        }