Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public static void RemoveFromCache(ContentReference contentLink)
 {
     _cache.Remove(CreateMasterCacheKey(contentLink));
 }