public ActionResult <Hotel> GetHotel(int id) { Hotel hotel = _hotelDao.Get(id); if (hotel != null) { return(hotel); } else { return(NotFound()); } }
public ActionResult <Hotel> Get(string id) { Hotel hotel = _dao.Get(id); if (hotel != null) { return(hotel); } else { return(NotFound()); } }
public Hotel GetHotel(int id) { Hotel hotel = _hotelDao.Get(id); if (hotel != null) { return(hotel); } return(null); }
public Hotel GetHotel(int id) { // TODO 01: Return 404 if the Id is not found (using NotFound()). Change return type to ActionResult<> Hotel hotel = hotelDao.Get(id); if (hotel != null) { return(hotel); } return(null); }
public void Create(Reservation reservation, string hotelID) { reservation.Id = GetMaxIdPlusOne(); reservation.Hotel = hotelDao.Get(hotelID); Reservations.Add(reservation); }