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 } })); } }
public ActionResult Delete(int id) { try { _deleteReservationCommand.Execute(id); return(NoContent()); }catch (NotFoundException) { return(NotFound()); }catch (Exception) { return(StatusCode(500, "Server error, try later")); } }