public async Task <ActionResult <FormaPagamentoViewModel> > Adicionar(FormaPagamentoViewModel FormaPagamentoViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(CustomResponse(ModelState));
            }

            await _formaPagamentoService.Adicionar(_mapper.Map <FormaPagamento>(FormaPagamentoViewModel));

            return(CustomResponse(FormaPagamentoViewModel));
        }
예제 #2
0
 public void Post([FromBody] FormaPagamento formaPagamento)
 {
     try
     {
         _service.Adicionar(formaPagamento);
     }
     catch (Exception)
     {
         Response.StatusCode = 400;
     }
 }