static void Main(string[] args) { var student = new Student(); student.studentList.Add(new Student() { Id = 1, Name = "hina", Grade = 20 }); student.studentList.Add(new Student() { Id = 2, Name = "zoya", Grade = 50 }); student.studentList.Add(new Student() { Id = 3, Name = "mona", Grade = 67 }); student.studentList.Add(new Student() { Id = 4, Name = "lola", Grade = 12 }); MutliCastDelegate del; del = new MutliCastDelegate(student.SaySomething); del += student.StudentId; del(student.studentList); var isPassed = new IsPassed(Passed); student.CkeckDuplictes(student.studentList, isPassed); Console.ReadLine(); }
public static void resultStudent(List<Student> listStudent, IsPassed delPassed) { foreach (Student stu in listStudent) { if (delPassed(stu)) { Console.WriteLine("Congratulation !!! {0} you are Passed!", stu.SName); } } }
public static void resultStudent(List <Student> listStudent, IsPassed delPassed) { foreach (Student stu in listStudent) { if (delPassed(stu)) { Console.WriteLine("Congratulation !!! {0} you are Passed!", stu.SName); } } }
public void CkeckDuplictes(List <Student> studentList, IsPassed passed) { foreach (var student in studentList) { if (passed(student)) { Console.WriteLine("{0} has cleared", student.Name); } } }
public override int GetHashCode() { return(Person.GetHashCode() + IsPassed.GetHashCode() + CountPassed.GetHashCode() + CountTickets.GetHashCode()); }