コード例 #1
0
        public async Task <ActionResult <Response> > CreateResponse(ResponseInputViewModel viewModel)
        {
            if (viewModel == null)
            {
                return(BadRequest());
            }

            Response createdResponse = await ResponseService.AddResponse(Mapper.Map <Response>(viewModel));

            return(CreatedAtAction(nameof(Get_ResponseId),
                                   new { id = createdResponse.Id },
                                   Mapper.Map <UserViewModel>(createdResponse)));
        }
コード例 #2
0
 public async Task <IActionResult> PostResponse([FromBody] Response response)
 {
     _responseService.AddResponse(response.Text, response.RespondedBy, response.QuestionId);
     return(Ok());
 }