Example #1
0
 public ActionResult Index(PageFilter pageFilter, SortFilter sortFilter, PageSizeFilter pageSizeFilter,
                           SearchFilter searchFilter)
 {
     var seperators = new[] {" ", "-"};
     string[] tokens = searchFilter.Keyword.Split(seperators, StringSplitOptions.RemoveEmptyEntries);
     ViewModel = new FilterViewModelBase(pageSizeFilter, sortFilter, pageFilter, searchFilter);
     expression = obj => tokens.All(t => obj.DisplayName.Contains(t));
     IEnumerable<Product> products = productRepository.GetProductWithProducersByExpression(expression);
     StartInitializeCommon(products.Count());
     EndInitializeCommon(products);
     return View(ViewModel);
 }
Example #2
0
 public FilterViewModelBase(PageSizeFilter pageSizeFilter, SortFilter sortFilter, PageFilter pageFilter, SearchFilter searchFilter)
     : this(pageSizeFilter, sortFilter, pageFilter)
 {
     this.SearchFilter = searchFilter;
     this.Filters.Add(searchFilter);
 }