Пример #1
0
        public async Task <IActionResult> Search(string searchAlgorithm, string queryText)
        {
            // Return these values to the view so that the view would not be reset after every search.
            ViewData["searchAlgorithm"] = searchAlgorithm;
            ViewData["queryText"]       = queryText;

            var posts = new List <Post>(await RssParser.ReadFeedsAsync());
            await HtmlParser.FetchPostContents(posts);

            SearchAlgorithm.FilterPosts(posts, queryText, searchAlgorithm);
            return(View(posts));
        }