示例#1
0
        public virtual PortalSearchModel Search(string search)
        {
            PortalSearchModel portalSearchModel = new PortalSearchModel
            {
                SearchString = search
            };

            if (string.IsNullOrEmpty(search))
            {
                return(portalSearchModel);
            }

            loremIpsumText = loremIpsumText.ToLower();

            string[] splited = loremIpsumText.Split(" ");

            portalSearchModel.Results = splited
                                        .Where(t => t.StartsWith(search.ToLower()))
                                        .ToList();

            return(portalSearchModel);
        }
        public IActionResult Index(string searchString)
        {
            PortalSearchModel portalSearchModel = _portalSearchBL.Search(searchString);

            return(View(portalSearchModel));
        }