コード例 #1
0
        public async Task <IActionResult> Index(int hotel)
        {
            //return RedirectToAction("Results", new { hotels });
            var result = await _hotel.GetAllHotels();

            return(View(result));
        }
コード例 #2
0
        /// <summary>
        /// This GET action returns all table data to the Index page
        /// </summary>
        /// <returns>The result of an action method</returns>
        public async Task <IActionResult> Index(string searchString)
        {
            if (!String.IsNullOrEmpty(searchString))
            {
                return(View(await _hotel.SearchHotels(searchString)));
            }

            return(View(await _hotel.GetAllHotels()));
        }
コード例 #3
0
        public IHttpActionResult Get()
        {
            var hotels = _hotelManager.GetAllHotels().AsEnumerable();

            if (!hotels.Any())
            {
                return(NotFound());
            }
            else
            {
                return(Ok(hotels));
            }
        }
コード例 #4
0
 public async Task <ActionResult <IEnumerable <HotelDTO> > > GetHotels()
 {
     return(await _hotels.GetAllHotels());
 }
コード例 #5
0
        public List <Hotels> GetAllHotel()
        {
            List <Hotels> resultlist = _hotelManager.GetAllHotels();

            return(resultlist);
        }
コード例 #6
0
        // GET: api/Booking

        public List <Hotel> GetHotels()
        {
            var hotel = _IHotelManager.GetAllHotels();

            return(hotel);
        }
コード例 #7
0
        public async Task <IActionResult> Index()
        {
            var result = await _hotel.GetAllHotels();

            return(View(result));
        }
コード例 #8
0
 public IHttpActionResult GetHotels()
 {
     return(Ok(_hotelManager.GetAllHotels()));
 }