Ejemplo n.º 1
0
        // 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);
        }
Ejemplo n.º 3
0
        // GET: Instructors
        public ActionResult Index()
        {
            var instructors = InstructorRepository.GetInstructors();

            return(View(instructors));
        }
Ejemplo n.º 4
0
 public ActionResult Get()
 {
     return(Ok(repo.GetInstructors()));
 }