Esempio n. 1
0
 public IActionResult Delete(int id)
 {
     try
     {
         var search = new OrderSearch
         {
             Id = id
         };
         _deleteOrders.Execute(search);
         return(Ok());
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Esempio n. 2
0
 public IActionResult Delete(int id)
 {
     try
     {
         var search = new OrderSearch
         {
             Id = id
         };
         _deleteOrders.Execute(search);
         return(Redirect("~/Orders"));
     }
     catch (EntityNotFoundException e)
     {
         TempData["message"] = e.Message;
         return(Redirect("~/Orders"));
     }
     catch (Exception e)
     {
         TempData["message"] = e.Message;
         return(Redirect("~/Orders"));
     }
 }