public IActionResult Create(CreationQuestionDto questionDto) { var q = new Question(); repository.Add(q); return(StatusCode(201, q)); }
public IActionResult Add(CreationQuestionDto questionDto) { if (ModelState.IsValid) { var question = mapper.Map <Question>(questionDto); var ques = repository.Add(question); return(StatusCode(201, ques)); } return(BadRequest()); }