예제 #1
0
        public ActionResult <Hotel> GetHotel(int id)
        {
            Hotel hotel = _hotelDao.Get(id);

            if (hotel != null)
            {
                return(hotel);
            }
            else
            {
                return(NotFound());
            }
        }
예제 #2
0
        public ActionResult <Hotel> Get(string id)
        {
            Hotel hotel = _dao.Get(id);

            if (hotel != null)
            {
                return(hotel);
            }
            else
            {
                return(NotFound());
            }
        }
예제 #3
0
        public Hotel GetHotel(int id)
        {
            Hotel hotel = _hotelDao.Get(id);

            if (hotel != null)
            {
                return(hotel);
            }

            return(null);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public void Create(Reservation reservation, string hotelID)
 {
     reservation.Id    = GetMaxIdPlusOne();
     reservation.Hotel = hotelDao.Get(hotelID);
     Reservations.Add(reservation);
 }