Exemplo n.º 1
0
        /// <summary>
        /// 提问的搜索
        /// </summary>
        static Searcher()
        {
            var engines = new ISearchEngine[]
            {
                new BaiduSearchEngine {
                    MatchMode = MatchMode.Accurate
                },
                new BingSearchEngine {
                    MatchMode = MatchMode.Fuzzy
                },
                new ZhidaoSearchEngine {
                    MatchMode = MatchMode.Fuzzy
                },
                new NoResultSearchEngine()
            };

            engines.Aggregate((cur, next) =>
            {
                cur.Next = next;
                return(next);
            });
            searchEngine = engines.FirstOrDefault();
        }