コード例 #1
0
 public BookController(IRepository <ApplicationUser> applicationUserRepository,
                       IRepository <Book> bookRepository,
                       IRepository <Genre> genreRepository,
                       IRepository <Tag> tagRepository,
                       IRepository <Comment> commentRepository,
                       IRepository <BookUser> bookUserRepository,
                       IUpdateService <Book> bookUpdateService,
                       IUpdateService <Comment> commentUpdateService,
                       UserManager <ApplicationUser> userManager,
                       IFactory <Comment, CommentResponseModel> commentFactory,
                       BookDataServices dataService,
                       IMapper objectMapper,
                       ISearchFactory searchFactory)
 {
     this.applicationUserRepository = applicationUserRepository;
     this.bookRepository            = bookRepository;
     this.genreRepository           = genreRepository;
     this.tagRepository             = tagRepository;
     this.bookUserRepository        = bookUserRepository;
     this.commentRepository         = commentRepository;
     this.bookUpdateService         = bookUpdateService;
     this.commentUpdateService      = commentUpdateService;
     this._userManager   = userManager;
     this.commentFactory = commentFactory;
     this.dataService    = dataService;
     this.objectMapper   = objectMapper;
     this.searchFactory  = searchFactory;
 }
コード例 #2
0
        public BlogService(ILoggerFactory loggerFactory, ISearchFactory factory)
        {
            var logger = loggerFactory.CreateLogger <BlogService>();

            //创建查询客户端

            search = factory.CreateSearchClient(searchIndex, logger);
        }
コード例 #3
0
            public SearchCommand(ISearchFactory factory, string cmdPath)
            {
                this.factory = factory;
                var builder = new CommandBuildInfo(
                    this,
                    Method,
                    new CommandAttribute(cmdPath));

                Command = new BotCommand(builder);
            }
コード例 #4
0
        public void TestNameSearch()
        {
            SearchCriteria sc = new SearchCriteria();

            sc.SearchType = enmSearchTypes.NameSearch;
            sc.Name       = "TextName";

            ISearchFactory       nameFactory = SearchFactory.GetFactory(sc.SearchType);
            ISearchType          searchType  = nameFactory.CreateSearchType(sc);
            List <ISearchResult> result      = searchType.Search();
        }
コード例 #5
0
        public void TestNumberSearch()
        {
            SearchCriteria sc = new SearchCriteria();

            sc.SearchType = enmSearchTypes.NumberSearch;
            sc.IDNumber   = 123456;

            ISearchFactory       numberFactory = SearchFactory.GetFactory(sc.SearchType);
            ISearchType          searchType    = numberFactory.CreateSearchType(sc);
            List <ISearchResult> result        = searchType.Search();
        }
コード例 #6
0
ファイル: SearchController.cs プロジェクト: bccurry/miRNAWeb
 public SearchController(IQueryDispatcher qry, ICommandDispatcher cmd, ISearchFactory searchFactory,
                         IValidationFactory validationFactory, IAbstractFactory abstractFactory, ILogEntropyFactory logEntropyFactory)
 {
     _qry               = qry;
     _cmd               = cmd;
     _searchFactory     = searchFactory;
     _validationFactory = validationFactory;
     _abstractFactory   = abstractFactory;
     _logEntropyFactory = logEntropyFactory;
     _hubContext        =
         GlobalHost.ConnectionManager.GetHubContext <MessageHub>();
 }
コード例 #7
0
ファイル: RequestRunner.cs プロジェクト: gamma9mu/HomeRoom
        /// <summary>
        /// Searches with a given ISearchFactory's crawlers.
        /// </summary>
        /// <param name="searchfactory">The search factory to use.</param>
        /// <returns>The combined results of the searches.</returns>
        private List<Result> searchWith(ISearchFactory searchfactory)
        {
            ICrawler c = searchfactory.createWebCrawler();
            List<Result> results = c.find(request.topic, webCount);

            c = searchfactory.createImageCrawler();
            results.AddRange(c.find(request.topic, imageCount));

            c = searchfactory.createVideoCrawler();
            results.AddRange(c.find(request.topic, videoCount));

            c = searchfactory.createAudioCrawler();
            results.AddRange(c.find(request.topic, audioCount));

            return results;
        }
コード例 #8
0
        public DoStrategyQuery(IList <SearchElement <T> > list, IQueryable <T> query, ISearchFactory factory)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            _list          = list;
            _query         = query;
            _searchFactory = factory;
        }
コード例 #9
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.DataContext = this;
            InitializeComponent();

            SRegistry sRegistry = new SRegistry();
            SStartM   sStart    = new SStartM();
            SServices sServices = new SServices();

            ISearchFactory searchFactory     = sRegistry;
            ISearchFactory searchFactorySt   = sStart;
            ISearchFactory searchFactoryServ = sServices;

            List <ISearchFactory> ll = new List <ISearchFactory> {
                searchFactory, searchFactorySt, searchFactoryServ
            };
            SearchFactoryContol searchFactoryContol = new SearchFactoryContol(ll);

            searchFactoryContol.observableCollection.CollectionChanged += ObservableCollection_CollectionChanged;

            searchFactoryContol.SecureEventHandler += SearchFactoryContol_SecureEventHandler;;
            searchFactoryContol.StartSearch();
        }
コード例 #10
0
 public Registrar(IUniqueIdentifier <string, ICitizen> identitySearch, ISearchFactory factory)
 {
     _identitySearch = identitySearch;
     _factory        = factory;
     _citizens       = new List <ICitizen>();
 }
コード例 #11
0
 public SearchController(ILogger <SearchController> logger, IMemoryCache memoryCache, ISearchFactory searchFactory)
 {
     _logger        = logger;
     _memoryCache   = memoryCache;
     _searchFactory = searchFactory;
 }
コード例 #12
0
 public HomeController(ICreateFactory iCreateFactory, ISearchFactory iSearchFactory)
 {
     _iCreateFactory = iCreateFactory;
     _iSearchFactory = iSearchFactory;
 }
コード例 #13
0
 public async Task Search(ISearchFactory searchFactory, Predicate <float> update)
 {
     await Execute(searchFactory.GeneralSearch, update);
     await Execute(searchFactory.ReferenceSearch, update);
 }
コード例 #14
0
 public async Task Search(ISearchFactory searchFactory)
 {
     await Search(searchFactory, progress => false);
 }