public IEnumerable <Employee> SortByLastName(string ascendingORdescending) { IEnumerable <Employee> employees; if (ascendingORdescending == "ascending") { employees = (from s in GetList() orderby s.LastName ascending select s).ToList(); } else { employees = (from s in GetList() orderby s.LastName descending select s).ToList(); } foreach (Employee employee in employeesDAO.GetList()) { Remove(employee); } foreach (Employee employee in employees) { Add(employee); } return(employees); }
public IEnumerable <Employee> GetList() { return(employeesDAO.GetList()); }