Esempio n. 1
0
        public ActionResult <Hotel> GetHotel(int id)
        {
            Hotel hotel = _hotelDao.Get(id);

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

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

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

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