private List <ITemplateBuilder> CreateTemplateBuilders()
        {
            // Setup templates
            var storeTemplateBuilder     = new ProductCatalogGroupTemplateBuilder(_log);
            var categoryTemplateBuilder  = new ProductCategoryTemplateBuilder(_log);
            var catalogTemplateBuilder   = new ProductCatalogTemplateBuilder(_log);
            var uCommerceTemplateBuilder = new UCommerceTemplateBuilder();
            var storesTemplateBuilder    = new StoresTemplateBuilder();

            var builders = new List <ITemplateBuilder>
            {
                uCommerceTemplateBuilder,
                storesTemplateBuilder,
                storeTemplateBuilder,
                catalogTemplateBuilder,
                categoryTemplateBuilder
            };

            // Include product and variant templates if product item data is included in the data provider.
            if (_dataProviderSettings.IncludeProductData)
            {
                var productTemplateBuilder = new ProductTemplatesBuilder(_log);
                var variantTemplateBuilder = new ProductVariantTemplatesBuilder(_log);

                builders.Add(productTemplateBuilder);
                builders.Add(variantTemplateBuilder);
            }

            return(builders);
        }
        public ProductsDataProvider(ILoggingService log, ProductNodeSitecoreItemFactory itemFactory, IList <ITemplateFieldValueProvider> valueProviders)
        {
            _log         = log;
            _itemFactory = itemFactory;
            _firstLevelIds.Add(FieldIds.Product.ProductsRootFolderId);

            _sitecoreItems = new ConcurrentDictionary <ID, ISitecoreItem>();

            _productValueProvider = valueProviders.OfType <ProductTemplatesBuilder>().First();
            _variantValueProvider = valueProviders.OfType <ProductVariantTemplatesBuilder>().First();

            WeAreReady = false;
        }