Example #1
0
        // GET: Students
        public IActionResult Index(
            string sortOrder,
            int?pageNumber)
        {
            ViewData["CurrentSort"]   = sortOrder;
            ViewData["NameSortParm"]  = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewData["GroupSortParm"] = sortOrder == "Group" ? "Group_desc" : "Group";

            var students = _servStudents.GetSortStudents(sortOrder);

            int pageSize = 10;

            return(View(PaginatedList <StudentsViewModel> .CreateAsync(students, pageNumber ?? 1, pageSize)));
        }