示例#1
0
        public async Task <ActionResult <HotelDTO> > GetHotel(int id)
        {
            var hotel = await _hotels.GetHotelByID(id);

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

            return(hotel);
        }
示例#2
0
        // GET: Hotels/Details/5
        public async Task <IActionResult> Details(int id)
        {
            if (id <= 0)
            {
                return(NotFound());
            }

            var hotel = await _context.GetHotelByID(id);

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

            return(View(hotel));
        }
示例#3
0
        public async Task <IActionResult> Results(int hotelId)
        {
            //   List<Hotels> hotels = //query for all hotels here

            // return View(hotels);
            var result = await _hotel.GetHotelByID(hotelId);

            return(View(result));
        }