コード例 #1
0
        public IActionResult Search(SearchAdViewModel model)
        {
            AdFilterService adFilter = new AdFilterService(advertisementRepo);

            model.advertisements = adFilter.GetAdsByFilter(model.searchFilter);
            LoadFilterData(model.searchFilter);
            return(View(model));
        }
コード例 #2
0
        public IActionResult Search()
        {
            SearchAdViewModel searchAdViewModel = new SearchAdViewModel();

            LoadFilterData(searchAdViewModel.searchFilter);
            searchAdViewModel.advertisements = advertisementRepo.GetTable()
                                               .Include(ad => ad.bikeModel)
                                               .Include(ad => ad.bikeModel.bikeBrand)
                                               .ToList();

            return(View(searchAdViewModel));
        }