public IHttpActionResult PostVenda_PagamentoViewModel(Venda_PagamentoViewModel venda_PagamentoViewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _venda_PagamentoAppService.Criar(venda_PagamentoViewModel); return(CreatedAtRoute("DefaultApi", new { id = venda_PagamentoViewModel.Id }, venda_PagamentoViewModel)); }
public IHttpActionResult DeleteVenda_PagamentoViewModel(Guid id) { Venda_PagamentoViewModel venda_PagamentoViewModel = _venda_PagamentoAppService.BuscarPorId(id); if (venda_PagamentoViewModel == null) { return(NotFound()); } _venda_PagamentoAppService.Deletar(id); return(Ok(venda_PagamentoViewModel)); }
public IHttpActionResult PutVenda_PagamentoViewModel(Guid id, Venda_PagamentoViewModel venda_PagamentoViewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != venda_PagamentoViewModel.Id || !Venda_PagamentoViewModelExists(id)) { return(BadRequest()); } _venda_PagamentoAppService.Atualizar(venda_PagamentoViewModel); return(StatusCode(HttpStatusCode.NoContent)); }