public HttpResponseMessage Put(ArmazemViewModel armazemViewModel) { if (ModelState.IsValid) { _armazemApp.Update(armazemViewModel); return Request.CreateResponse(HttpStatusCode.Created, "Armazém atualizado com sucesso!"); } return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); }
public HttpResponseMessage Post(ArmazemViewModel armazemViewModel) { if (ModelState.IsValid) { _armazemApp.Add(armazemViewModel); return Request.CreateResponse(HttpStatusCode.Created, armazemViewModel); } return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); }