public async Task <ActionResult> Create(StudentModel data) { try { await coursesRepository.CreateAsync(new Student { AverageMark = data.AverageMark, BirthYear = data.BirthYear, FirstName = data.FirstName, LastName = data.LastName, GroupId = data.GroupId }); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }