public IActionResult Delete(int id) { try { var hotel = hotelRepository.GetById(id); if (hotel == null) { return(NotFound()); } hotelRepository.DeleteById(id); return(Ok()); } catch (Exception e) { return(StatusCode(500, e.Message)); } }