using System.Collections.Generic;
using System.Collections;
public delegate bool PromoteDelegate(Employee emp);
public static PromoteDelegate PromoteDelegateObj = null;
public string Name {get;set;}
public double Salary {get;set;}
public double Experience {get;set;}
public static void PromoteEmployee(List<Employee> employees){
if(PromoteDelegateObj==null) throw new Exception("PromoteDelegate Should not be null");
foreach(var emp in employees){
if(PromoteDelegateObj(emp)){
Console.WriteLine(emp.Name);
public static void Main()
var employees = new List<Employee>();
employees.Add(new Employee(){ID=1,Name="shihab",Salary=35000,Experience=2.9});
employees.Add(new Employee(){ID=2,Name="Arun",Salary=25000,Experience=2.1});
employees.Add(new Employee(){ID=3,Name="Kiran",Salary=30000,Experience=2.9});
Employee.PromoteDelegateObj = delegate(Employee emp){
if(emp.Experience>2.5) return true;
Employee.PromoteEmployee(employees);
public static bool IsEligibleToPromote(Employee emp){
if(emp.Experience>2.5) { return true; }