public IActionResult Debitar(int id, double valor) { try { return(new ObjectResult(service.Debitar(id, valor))); } catch (ArgumentException ex) { return(NotFound(ex)); } catch (Exception ex) { return(BadRequest(ex)); } }
public IActionResult Debitar([FromBody] ObjetoEntrada objetoEntrada) { try { var retorno = service.Debitar(objetoEntrada.id, objetoEntrada.valor); return(new ObjectResult(retorno)); } catch (ArgumentNullException ex) { return(NotFound(ex)); } catch (Exception ex) { return(BadRequest(ex)); } }