public async Task Add(QuestionTypeInputModel model)
        {
            QuestionType questionType = model.To <QuestionType>();
            await repository.AddAsync(questionType);

            await repository.SaveChangesAsync();
        }
예제 #2
0
        public async Task <IActionResult> Create(QuestionTypeInputModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            await questionTypeService.Add(model);

            return(RedirectToAction("Index", "Home"));
        }