public IActionResult AddNewQuestion() { var model = new NewQuestionVm() { Categories = _categoryAndQuestionService.GetCategories() }; return(View(model)); }
public int AddQuestion(NewQuestionVm questionVm) { var question = _mapper.Map <Question>(questionVm); _categoryAndQuestionRepo.DeleteCategoryFromFinishedCategories(question.CategoryId); var id = _categoryAndQuestionRepo.AddQuestion(question); return(id); }
public IActionResult AddNewQuestion(NewQuestionVm model) { var id = _categoryAndQuestionService.AddQuestion(model); return(new RedirectResult(Url.Action("ShowNewQuestion", new { Id = id }))); }