public async Task <ActionResult> Create(CourseModel data) { try { await coursesRepository.CreateAsync(new Course { Id = data.Id, LectorName = data.LectorName, Name = data.Name }); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }