예제 #1
0
        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 }));
        }