public async Task <ActionResult <FormaPagamentoViewModel> > Adicionar(FormaPagamentoViewModel FormaPagamentoViewModel) { if (!ModelState.IsValid) { return(CustomResponse(ModelState)); } await _formaPagamentoService.Adicionar(_mapper.Map <FormaPagamento>(FormaPagamentoViewModel)); return(CustomResponse(FormaPagamentoViewModel)); }
public void Post([FromBody] FormaPagamento formaPagamento) { try { _service.Adicionar(formaPagamento); } catch (Exception) { Response.StatusCode = 400; } }