Exemple #1
0
        public ActionResult SearchResults(Models.SearchCriteria ts)
        {
            var resultsAll = new Models.SearchResults().GetList();
            IEnumerable <Models.SearchResults> resultsFiltterd = resultsAll;

            if (ts.Name != null)
            {
                resultsFiltterd = resultsAll.Where(x => x.Name.Contains(ts.Name) || x.Content.Contains(ts.Name))
                                  .Select(x => x);

                var resultsFiltterd2 = (from x in resultsAll
                                        where x.Name.Contains(ts.Name) || x.Content.Contains(ts.Name)
                                        select x
                                        );
            }


            var items = new Models.SearchVM()
            {
                param   = ts,
                results = resultsFiltterd
            };

            TempData["name"] = ts.Name;
            return(View("SearchResults", items));
        }
Exemple #2
0
        public ActionResult SearchResults()
        {
            var resultsAll = new Models.SearchResults().GetList();
            var items      = new Models.SearchVM()
            {
                param   = new Models.SearchCriteria(),
                results = resultsAll
            };

            return(View("SearchResults", items));
        }