using System.Collections.Generic;
public static void Main()
List<Employee> empList = new List<Employee>();
empList.Add(new Employee(){ID = 101,Name = "Kiran",Experience = 5});
empList.Add(new Employee(){ID = 102,Name = "Pavan",Experience = 8});
empList.Add(new Employee(){ID = 101,Name = "sai",Experience = 1});
IsPromotable ispromotable = new IsPromotable(promoted);
Employee.PromotedEmployee(empList,promoted);
Employee.PromotedEmployee(empList,emp => emp.Experience >= 5);
public static bool promoted(Employee emp){
public delegate bool IsPromotable(Employee emp);
public string Name {get; set;}
public int Experience{get; set;}
public static void PromotedEmployee(List<Employee> emplist, IsPromotable isEligibleToPromote){
foreach(var emp in emplist){
if(isEligibleToPromote(emp)){
Console.Write(emp.Name + " is promoted, ");