private List <Hotel> GetTestHotels() { var hotelbuisness = new HotelBusiness(); var hotels = hotelbuisness.GetHotels(); if (hotels != null) { var data = hotels.Hotels; return(data); } return(new List <Hotel>()); }
public IActionResult Index(string searchString) { HotelBusiness business = new HotelBusiness(); ViewBag.AllHotels = business.GetHotels(); if (string.IsNullOrEmpty(searchString)) { return(View()); } else { ViewBag.SearchedHotels = business.GetHotelSearchResult(searchString); } return(View()); }
public IEnumerable <Hotel> GetAllHotels() { try { var hotelbuisness = new HotelBusiness(); var hotels = hotelbuisness.GetHotels(); if (hotels != null) { data = hotels.Hotels; return(data); } return(new List <Hotel>()); } catch (Exception) { return(new List <Hotel>()); } }