Esempio n. 1
0
        public async Task <IActionResult> Put(Guid id, [FromBody] CreateQuestionRequestModel requestModel)
        {
            var responseUpdate = await _mediator.Send(new UpdateQuestionCommand(id, requestModel.Question, requestModel.ImageUrl, requestModel.ThumbUrl, requestModel.Choices));

            var response = await _mediator.Send(new GetQuestionQuery(responseUpdate.Id));

            return(CreatedAtAction(nameof(GetById), new { id = response.Id }, response));
        }
Esempio n. 2
0
 public int Create(CreateQuestionRequestModel model)
 {
     return(_repo.Create(_mapper.Map <Question>(model)));
 }
Esempio n. 3
0
 public int Create(CreateQuestionRequestModel model)
 {
     return(_question.Create(model));
 }