public override double GetSalary(string type, Employee entity) { switch (type) { case EmployeeType.Montly: return(MonthlySalaryEmployee.GetSalary(entity.MonthlySalary)); case EmployeeType.Hourly: return(HourlySalaryEmployee.GetSalary(entity.HourlySalary)); default: throw new ApplicationException(string.Format("Employee type {0} cannot be created", type)); } }