public HttpResponseMessage Put(ValoresViewModel valoresViewModel) { if (ModelState.IsValid) { _valoresApp.Add(valoresViewModel); return Request.CreateResponse(HttpStatusCode.Created, "Cadastro efetuado com sucesso!"); } return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); }
public HttpResponseMessage Post(ValoresViewModel valoresViewModel) { if (ModelState.IsValid) { _valoresApp.Add(valoresViewModel); return Request.CreateResponse(HttpStatusCode.Created, valoresViewModel); } return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); }