Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Minor changes - remove not need notification handler

KrzysztofPajak4a9feef9d045
diff --git a/src/Web/Grand.Web/Events/Cache/CacheKeyConst.cs b/src/Web/Grand.Web/Events/Cache/CacheKeyConst.cs
index 68c7617e5..950a86f37 100644
--- a/src/Web/Grand.Web/Events/Cache/CacheKeyConst.cs
+++ b/src/Web/Grand.Web/Events/Cache/CacheKeyConst.cs
@@ -172,7 +172,6 @@ namespace Grand.Web.Events.Cache
/// {3} : language ID
/// </remarks>
public const string KNOWLEDGEBASE_CATEGORY_BREADCRUMB_KEY = "Grand.knowledgebase.category.breadcrumb-{0}-{1}-{2}-{3}";
- public const string KNOWLEDGEBASE_CATEGORY_BREADCRUMB_PATTERN_KEY = "Grand.knowledgebase.category.breadcrumb";
/// <summary>
/// Key for caching of categories displayed on home page
@@ -183,7 +182,6 @@ namespace Grand.Web.Events.Cache
/// {2} : language ID
/// </remarks>
public const string CATEGORY_HOMEPAGE_KEY = "Grand.category.homepage-{0}-{1}-{2}";
- public const string CATEGORY_HOMEPAGE_PATTERN_KEY = "Grand.category.homepage";
public const string CATEGORY_FEATURED_PRODUCTS_HOMEPAGE_KEY = "Grand.category.homepage-fp-{0}-{1}-{2}";
/// <summary>
@@ -276,8 +274,7 @@ namespace Grand.Web.Events.Cache
/// {0} : current product id
/// {1} : current store ID
/// </remarks>
- public const string PRODUCTS_RELATED_IDS_KEY = "Grand.product.id-{0}-{1}.pres.related";
- public const string PRODUCTS_RELATED_IDS_PATTERN_KEY = "Grand.product.id-{0}.pres.related";
+ public const string PRODUCTS_RELATED_IDS_KEY = "Grand.product.id-{0}-{1}.pres.related";
/// <summary>
/// Key for "similar" product identifiers displayed on the product details page
@@ -287,8 +284,7 @@ namespace Grand.Web.Events.Cache
/// {1} : current store ID
/// </remarks>
public const string PRODUCTS_SIMILAR_IDS_KEY = "Grand.product.id-{0}-{1}.pres.similar";
- public const string PRODUCTS_SIMILAR_IDS_PATTERN_KEY = "Grand.product.id-{0}.pres.similar";
-
+
/// <summary>
/// Key for blog tag list model
/// </summary>
diff --git a/src/Web/Grand.Web/Events/Cache/ProductNotificatioHandler.cs b/src/Web/Grand.Web/Events/Cache/ProductNotificatioHandler.cs
deleted file mode 100644
index 5eb6d5e49..000000000
--- a/src/Web/Grand.Web/Events/Cache/ProductNotificatioHandler.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Grand.Infrastructure.Caching;
-using Grand.Domain.Catalog;
-using Grand.Infrastructure.Events;
-using MediatR;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Grand.Web.Events.Cache
-{
- public class ProductNotificatioHandler : INotificationHandler<EntityUpdated<Product>>, INotificationHandler<EntityDeleted<Product>>
- {
-
- private readonly ICacheBase _cacheBase;
-
- public ProductNotificatioHandler(ICacheBase cacheBase)
- {
- _cacheBase = cacheBase;
- }
-
-
- public async Task Handle(EntityUpdated<Product> eventMessage, CancellationToken cancellationToken)
- {
- await _cacheBase.RemoveByPrefix(string.Format(CacheKeyConst.PRODUCTS_SIMILAR_IDS_PATTERN_KEY, eventMessage.Entity.Id));
- await _cacheBase.RemoveAsync(string.Format(CacheKeyConst.PRODUCTS_RELATED_IDS_PATTERN_KEY, eventMessage.Entity.Id));
- }
- public async Task Handle(EntityDeleted<Product> eventMessage, CancellationToken cancellationToken)
- {
- await _cacheBase.RemoveByPrefix(string.Format(CacheKeyConst.PRODUCTS_SIMILAR_IDS_PATTERN_KEY, eventMessage.Entity.Id));
- await _cacheBase.RemoveAsync(string.Format(CacheKeyConst.PRODUCTS_RELATED_IDS_PATTERN_KEY, eventMessage.Entity.Id));
- }
- }
-}
\ No newline at end of file