public List <string> ReturnAllDepartmentNames() { List <Department> totalListOfDepartments = dbcontext.Set <Department>().ToList(); List <string> listOfDepartmentNames = new List <string>(); foreach (Department d in totalListOfDepartments) { listOfDepartmentNames.Add(d.Name); } return(listOfDepartmentNames); }