private void OnAssociationUpdated(object sender, AssociationEventArgs e) { Logger.Debug("OnAssociationUpdated raised."); ICollection <ProductContent> products = GetProductsAffected(e); // HACK: Episerver does not clear the deleted associations from cache until after this event has completed. // In order to load the list of associations after deletions/updates, force delete the association list from cache. foreach (ProductContent entry in products) { _cache.Remove("EP:ECF:Ass:" + entry.ContentLink.ID); } _productExportService.ExportProductRecommendations(products, null); }
private void AssociationUpdated(CatalogContentUpdateEventArgs e) { Logger.Debug("AssociationUpdated raised."); IEnumerable <ContentReference> contentLinks = GetContentLinks(e); ICollection <ContentReference> affectedProductLinks = GetAffectedProductReferences(contentLinks).ToArray(); // HACK: Episerver does not clear the deleted associations from cache until after this event has completed. // In order to load the list of associations after deletions/updates, force delete the association list from cache. foreach (ContentReference entryRef in affectedProductLinks) { _cache.Remove("EP:ECF:Ass:" + entryRef.ID); } _productExportService.ExportProductRecommendations(affectedProductLinks, null); }
public static void RemoveFromCache(ContentReference contentLink) { _cache.Remove(CreateMasterCacheKey(contentLink)); }