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

            return(View(result));
        }
        /// <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()));
        }
Exemple #3
0
        public IHttpActionResult Get()
        {
            var hotels = _hotelManager.GetAllHotels().AsEnumerable();

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

            return(resultlist);
        }
Exemple #6
0
        // GET: api/Booking

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

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

            return(View(result));
        }
 public IHttpActionResult GetHotels()
 {
     return(Ok(_hotelManager.GetAllHotels()));
 }