public Models.TbPerguntaResposta ResponderParaTabela(Models.Request.AnuncioRoupasRequest.Resposta req) { Models.TbPerguntaResposta resp = new Models.TbPerguntaResposta(); resp.IdRespondedor = req.IdUsuarioRespondedor; resp.IdPerguntaResposta = req.IdPerguntaResposta; resp.DsResposta = req.Texto.Trim(); resp.BtRespondida = true; return(resp); }
public ActionResult <Models.Response.AnuncioRoupasResponse.PerguntaEResposta> Responder(Models.Request.AnuncioRoupasRequest.Resposta req) { try { Models.TbPerguntaResposta a = conversorAnuncio.ResponderParaTabela(req); Models.TbPerguntaResposta b = businessAnuncio.Responder(a); return(conversorAnuncio.ResponderParaResponse(b)); } catch (System.Exception ex) { return(BadRequest(new Models.Response.Erro(400, ex.Message))); } }