Exemplo n.º 1
0
        public static void RegisterVueStorefrontExporterDefaultService <TProduct>(this IServiceConfigurationProvider services, VsfExporterConfiguration vsfExporterConfiguration) where TProduct : VsfBaseProduct
        {
            services.AddSingleton(vsfExporterConfiguration);

            services.AddTransient <IAttributeMapper, AttributeMapper>();
            services.AddTransient <IMapper <VariationContent, VsfSimpleProduct>, SimpleProductMapper>();

            services.AddTransient <IContentExtractor, ContentExtractor>();
            services.AddSingleton <IVsfPriceService, VsfPriceService>();

            services.AddTransient <IExtractedContentHandler, ExtractedContentHandler <TProduct> >();
            services.AddTransient <IIndexingService, IndexingService <TProduct> >();

            services.AddTransient <IContentLoaderWrapper, CachedContentLoaderWrapper>(sc => new CachedContentLoaderWrapper(new ContentLoaderWrapper(sc.GetInstance <IContentLoader>())));
        }
Exemplo n.º 2
0
 public IndexingService(VsfExporterConfiguration configuration)
 {
     _configuration = configuration;
     _elasticClient = new ElasticClient(GetElasticConnectionSettings(_configuration.ElasticServerUrls, _configuration.ElasticUserName, _configuration.ElasticPassword));
     _indexManager  = new ElasticIndexManager(_elasticClient, _configuration.IndexAliasName);
 }