Beispiel #1
0
        static void Main()
        {
            List <DelEmployee> employees = new List <DelEmployee>
            {
                new DelEmployee()
                {
                    Id = 1, Name = "Bea", Experience = 6, Salary = 5000
                },
                new DelEmployee()
                {
                    Id = 1, Name = "Rob", Experience = 3, Salary = 2000
                },
                new DelEmployee()
                {
                    Id = 1, Name = "Mike", Experience = 7, Salary = 6000
                },
                new DelEmployee()
                {
                    Id = 1, Name = "Sul", Experience = 4, Salary = 4000
                }
            };
            IsPromotable isPromotable = new IsPromotable(Promote);

            //DelEmployee.PromoteEmployee(employees,isPromotable);
            DelEmployee.PromoteEmployee(employees, emp => emp.Experience >= 5);
            Console.ReadLine();
        }
Beispiel #2
0
 public static bool Promote(DelEmployee emp)
 {
     if (emp.Experience >= 5)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }