Esempio n. 1
0
 public IActionResult Delete(int id)
 {
     try
     {
         productService.DeleteProductById(id);
         return(Ok());
     }
     catch
     {
         throw new Exception("No se pudo eliminar el producto");
     }
 }
Esempio n. 2
0
 public IActionResult Delete(int id)
 {
     try
     {
         productsService.DeleteProductById(id);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, "No se pudo borrar ese producto"));
     }
 }
 public IActionResult Delete(int id)
 {
     try
     {
         productService.DeleteProductById(id);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(ThrowInternalErrorServer(ex));
     }
 }
 public static void RemoveProducto(int productId)
 {
     productService.DeleteProductById(productId);
 }