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))); }
public async Task <IActionResult> PostResponse([FromBody] Response response) { _responseService.AddResponse(response.Text, response.RespondedBy, response.QuestionId); return(Ok()); }