Ejemplo n.º 1
0
 public IActionResult Delete(int id)
 {
     try
     {
         deleteReservation.Execute(id);
         return(StatusCode(204));
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(new
         {
             Errors = new List <string> {
                 e.Message
             }
         }));
     }
     catch (Exception e)
     {
         return(StatusCode(500, new
         {
             Errors = new List <string> {
                 e.Message
             }
         }));
     }
 }
Ejemplo n.º 2
0
 public ActionResult Delete(int id)
 {
     try
     {
         _deleteReservationCommand.Execute(id);
         return(NoContent());
     }catch (NotFoundException)
     {
         return(NotFound());
     }catch (Exception)
     {
         return(StatusCode(500, "Server error, try later"));
     }
 }