// GET: Students
        public async Task <IActionResult> Index(string sortOrder, string searchString, int?variantId)
        {
            IEnumerable <Student> students;

            if (variantId != null)
            {
                students = await _studentRepository.GetStudentsInVariant(variantId.Value);
            }
            else
            {
                students = await _studentRepository.GetAllStudents();
            }
            if (!string.IsNullOrEmpty(searchString))
            {
                students = await StudentViewModel.SelectStudentsByNameOrLogin(students, searchString);
            }
            if (!string.IsNullOrEmpty(sortOrder))
            {
                students = await StudentViewModel.SortStudents(students, sortOrder);
            }
            var studentsVm = students.Select(StudentViewModel.CreateStudentVm);

            ViewBag.VariantId = variantId;
            ViewBag.NameSort  = sortOrder == "Name"
                                ? "name_desc" : "Name";
            ViewBag.LoginSort = sortOrder == "Login"
                                ? "login_desc" : "Login";
            ViewBag.VariantSort = sortOrder == "Variant"
                                ? "variant_desc" : "Variant";
            ViewData["Variants"] = new SelectList(await _variantRepository.GetAllVariants(), "Id", "Title");
            return(View(studentsVm));
        }