public async Task <Choise> CreateAsync(Choise choise) { var entity = await _choiseRepository.CreateAsync(choise); if (entity == null) { throw new ChoiseNotCreatedException(); } return(entity); }
public async Task <IActionResult> Create(Choise rpt) { if (!ModelState.IsValid) { return(View()); } rpt.Id = 0; await _repository.CreateAsync(rpt); return(RedirectToAction("Detail", "Questions", new { id = rpt.QuestionId })); }