public async Task <ActionResult <Room> > DeleteRoom(decimal id) { var room = _repository.GetByID(id); if (room == null) { return(NotFound(NotFoundEmptyJsonResult)); } try { _repository.Delete(room); _repository.Save(); } catch (DbUpdateException e) { return(StatusCode(500, InternalServerErrorJsonResult(e.Message))); } return(room); }
public IHttpActionResult DeleteOneRoom(int id) { _repository.Delete(id); return(Ok()); }