Пример #1
0
        public ActionResult Show(SearchPage page, [IoCModelBinder(typeof(WebpageSearchQueryModelBinder))] WebpageSearchQuery model)
        {
            ViewData["webpageSearchQueryModel"] = model;

            ViewData["searchResults"] = _webpageSearchService.Search(model);
            return(View(page));
        }
Пример #2
0
        public IPagedList <Webpage> Search(WebpageSearchQuery searchQuery)
        {
            IQueryOver <Webpage, Webpage> query = _session.QueryOver <Webpage>().Where(x => x.Parent.Id == searchQuery.ParentId);

            if (!string.IsNullOrWhiteSpace(searchQuery.Query))
            {
                query = query.Where(x => x.Name.IsInsensitiveLike(searchQuery.Query, MatchMode.Anywhere));
            }

            return(query.Paged(searchQuery.Page));
        }
Пример #3
0
        public ActionResult Show(SearchPage page, [IoCModelBinder(typeof(WebpageSearchQueryModelBinder))] WebpageSearchQuery model)
        {
            ViewData["webpageSearchQueryModel"] = model;

            if (string.IsNullOrWhiteSpace(model.Term))
            {
                return(View(page));
            }

            ViewData["searchResults"] = _webpageSearchService.Search(model);
            return(View(page));
        }
Пример #4
0
 public PartialViewResult Results(WebpageSearchQuery searchQuery)
 {
     ViewData["results"] = _webpageAdminSearchService.Search(searchQuery);
     return(PartialView(searchQuery));
 }
Пример #5
0
 public ViewResult Search(WebpageSearchQuery searchQuery)
 {
     return(View(searchQuery));
 }
Пример #6
0
 public IPagedList <Webpage> Search(WebpageSearchQuery model)
 {
     return(_documentSearcher.Search(model.GetQuery(), model.Page));
 }