public IActionResult GetHotels(GetHotels getHotels) { if (ModelState.IsValid) { var hotels = repository.GetHotelsByCity(getHotels); return(View(hotels)); } return(View(null)); }
public IEnumerable <Hotel> GetHotelsByCity(GetHotels hotel) { IEnumerable <Hotel> hotels = flightsDbContext.Hotels.Where(x => x.City == hotel.City.ToLower()); return(hotels); }