public ProductISearchIndexManager(ProductManager productManager,
                                   ProductSearchManager productSearchManager,
                                   ISearchIndexInfoProvider searchIndexInfoProvider,
                                   ISearchProviderFactory <Product> searchProviderFactory)
 {
     this.searchIndexInfoProvider = searchIndexInfoProvider;
     this.searchProviderFactory   = searchProviderFactory;
     this.productManager          = productManager;
     this.ProductSearchManager    = productSearchManager;
 }
Пример #2
0
        public ProductSearchManager(ProductManager productManager, ISearchIndexInfoProvider searchIndexInfoProvider, ISearchProviderFactory <Product> searchProviderFactory)
        {
            this.productManager          = productManager;
            this.searchIndexInfoProvider = searchIndexInfoProvider;
            this.searchProviderFactory   = searchProviderFactory;

            searchProvider = new Lazy <ISearchProvider <Product> >(() =>
            {
                var searchIndexInfo = searchIndexInfoProvider.GetCurrentSearchIndexInfo();

                if (searchIndexInfo == null)
                {
                    throw new InvalidOperationException("Cant get current search index info");
                }

                return(searchProviderFactory.GetProvider(searchIndexInfo.IndexFilesLocation));
            });
        }