Ejemplo n.º 1
0
        public ActionResult WalkSearch(WalkSearchViewModel searchViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(this.View(searchViewModel));
            }

            List <Walk> allWalks = this.repository.FindAllWalks().ToList();

            var walkSearchEngine = new WalkSearchEngine(new WalkSelector());

            WalkSearchResults searchResults = walkSearchEngine.PerformSearch(allWalks, Request.Form);

            searchViewModel.WalksFound           = searchResults.WalksFound.ToList();
            searchViewModel.SearchSummary        = searchResults.SearchSummary;
            searchViewModel.WalkResultsAvailable = true;

            return(this.View(searchViewModel));
        }
Ejemplo n.º 2
0
        public ActionResult WalkSearch()
        {
            var searchViewModel = new WalkSearchViewModel();

            return(View(searchViewModel));
        }