예제 #1
0
 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));
     }
 }
예제 #2
0
        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));
            }
        }