public IActionResult Delete(int id)
        {
            return(Ok(

                       _ClientesService.Delete(id)

                       ));
        }
Example #2
0
        public IHttpActionResult DeleteClientes(long id)
        {
            Clientes cliente;

            try {
                cliente = clientesService.Delete(id);
            }
            catch (NoEncontradoException e) {
                return(NotFound());
            }
            return(Ok(cliente));
        }
 public void Delete(int id)
 {
     try
     {
         var oCliente = clientesOps.GetById(id);
         if (oCliente != null)
         {
             clientesOps.Delete(id);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 public IActionResult Delete(int id)
 {
     try
     {
         var result = _clientesService.Delete(id);
         if (!result)
         {
             throw new Exception("No fue posible eliminar el registro");
         }
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
     return(Ok());
 }