// GET: Instructors public ActionResult Index(string _orderBy, string _sortDirection) { string currentSort = ""; if (_sortDirection == null && _orderBy != null) { ViewData["sortDirection"] = "desc"; currentSort = "asc"; } else if (_sortDirection == null && _orderBy == null) { _orderBy = "CohortId"; currentSort = "asc"; ViewData["sortDirection"] = ""; } else if (_sortDirection == "asc") { ViewData["sortDirection"] = "desc"; currentSort = "asc"; } else if (_sortDirection == "desc") { ViewData["sortDirection"] = "asc"; currentSort = "desc"; } var instructors = InstructorRepository.GetInstructors(_orderBy, currentSort); return(View(instructors)); }
public async Task <ICollection <Instructor> > GetAllInstructors() { var instructors = new List <Instructor>(); var allInstructorUsers = await _instructorRepository.GetInstructors(); foreach (var instructor in allInstructorUsers) { instructors.Add(await BuildInstructorModel(instructor)); } return(instructors); }
// GET: Instructors public ActionResult Index() { var instructors = InstructorRepository.GetInstructors(); return(View(instructors)); }
public ActionResult Get() { return(Ok(repo.GetInstructors())); }