示例#1
0
        public IActionResult Create(CreationQuestionDto questionDto)
        {
            var q = new Question();

            repository.Add(q);
            return(StatusCode(201, q));
        }
示例#2
0
 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());
 }