private static void DeleteProductVariantFromIndex(IProductVariant productVariant) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(productVariant.ProductKey); ProductIndexer.DeleteFromIndex(((ProductVariant)productVariant).ExamineId.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Removes a product with all of its variants from the index /// </summary> static void ProductServiceDeleted(IProductService sender, DeleteEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.DeletedEntities.ForEach(DeleteProductFromIndex); }
private static void IndexProductVariant(IProductVariant productVariant) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(productVariant.ProductKey); ProductIndexer.ReIndexNode(productVariant.SerializeToXml().Root, IndexTypes.ProductVariant); }
/// <summary> /// Adds or updates a product with all of its variants to the index /// </summary> static void ProductServiceSaved(IProductService sender, SaveEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.SavedEntities.ForEach(IndexProduct); }
/// <summary> /// Initializes a new instance of the <see cref="CachedProductQuery"/> class. /// </summary> /// <param name="merchelloContext"> /// The <see cref="IMerchelloContext"/>. /// </param> /// <param name="indexProvider"> /// The index provider. /// </param> /// <param name="searchProvider"> /// The search provider. /// </param> /// <param name="enableDataModifiers"> /// The enable data modifiers. /// </param> /// <param name="conversionType"> /// The is for back office editors. /// </param> internal CachedProductQuery(IMerchelloContext merchelloContext, BaseIndexProvider indexProvider, BaseSearchProvider searchProvider, bool enableDataModifiers, DetachedValuesConversionType conversionType) : base(merchelloContext.Cache, merchelloContext.Services.ProductService, indexProvider, searchProvider, enableDataModifiers) { _productService = (ProductService)merchelloContext.Services.ProductService; this._conversionType = conversionType; _productContentFactory = new Lazy <ProductContentFactory>(() => new ProductContentFactory()); _cache = new VirtualProductContentCache(merchelloContext.Cache, this.GetProductContent, enableDataModifiers); this.Initialize(); }
/// <summary> /// Removes a product with all of its variants from the index /// </summary> static void ProductServiceDeleted(IProductService sender, DeleteEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); foreach (var eDeletedEntity in e.DeletedEntities) { DeleteProductFromIndex(eDeletedEntity); } }
/// <summary> /// Adds or updates a product with all of its variants to the index /// </summary> static void ProductServiceSaved(IProductService sender, SaveEventArgs <IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); foreach (var eSavedEntity in e.SavedEntities) { IndexProduct(eSavedEntity); } }
/// <summary> /// The product option repository re index. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The product keys. /// </param> /// <remarks> /// REFACTOR v3 /// </remarks> private void ProductOptionRepositoryReIndex(ProductOptionRepository sender, Core.Events.ObjectEventArgs <IEnumerable <Guid> > e) { var keys = e.EventObject; if (MerchelloContext.HasCurrent) { var products = MerchelloContext.Current.Services.ProductService.GetByKeys(keys).ToArray(); var contentCache = new VirtualProductContentCache(); foreach (var p in products) { IndexProduct(p); // we also need to refresh the published product cache contentCache.ClearVirtualCache(p); } } }
/// <summary> /// Adds or updates a product with all of its variants to the index /// </summary> static void ProductServiceSaved(IProductService sender, SaveEventArgs<IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.SavedEntities.ForEach(IndexProduct); }
/// <summary> /// Removes a product with all of its variants from the index /// </summary> static void ProductServiceDeleted(IProductService sender, DeleteEventArgs<IProduct> e) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(e); e.DeletedEntities.ForEach(DeleteProductFromIndex); }
private static void IndexProductVariant(IProductVariant productVariant) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(productVariant.ProductKey); ProductIndexer.ReIndexNode(productVariant.SerializeToXml().Root, IndexTypes.ProductVariant); }
private static void DeleteProductVariantFromIndex(IProductVariant productVariant) { var cache = new VirtualProductContentCache(); cache.ClearVirtualCache(productVariant.ProductKey); ProductIndexer.DeleteFromIndex(((ProductVariant)productVariant).ExamineId.ToString(CultureInfo.InvariantCulture)); }