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.

Delete unused HistoryExtensions

KrzysztofPajak769235dedbc3
diff --git a/src/Business/Grand.Business.Core/Extensions/HistoryExtensions.cs b/src/Business/Grand.Business.Core/Extensions/HistoryExtensions.cs
deleted file mode 100644
index 33c2e454a..000000000
--- a/src/Business/Grand.Business.Core/Extensions/HistoryExtensions.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Grand.Business.Core.Interfaces.Common.Directory;
-using Grand.Domain;
-using Grand.Domain.History;
-
-namespace Grand.Business.Core.Extensions;
-
-public static class HistoryExtensions
-{
- /// <summary>
- /// Save an entity
- /// </summary>
- /// <param name="entity">Entity</param>
- /// <param name="historyService"></param>
- public static async Task SaveHistory<T>(this BaseEntity entity, IHistoryService historyService)
- where T : BaseEntity, IHistory
- {
- ArgumentNullException.ThrowIfNull(entity);
-
- await historyService.SaveObject(entity);
- }
-
- public static async Task<IList<HistoryObject>> GetHistoryObject(this BaseEntity entity,
- IHistoryService historyService)
- {
- return await historyService.GetHistoryObjectForEntity(entity);
- }
-}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.Marketing/Services/Newsletters/NewsLetterSubscriptionService.cs b/src/Business/Grand.Business.Marketing/Services/Newsletters/NewsLetterSubscriptionService.cs
index 6a356189e..770082589 100644
--- a/src/Business/Grand.Business.Marketing/Services/Newsletters/NewsLetterSubscriptionService.cs
+++ b/src/Business/Grand.Business.Marketing/Services/Newsletters/NewsLetterSubscriptionService.cs
@@ -83,7 +83,7 @@ public class NewsLetterSubscriptionService : INewsLetterSubscriptionService
await PublishSubscriptionEvent(newsLetterSubscription.Email, true, publishSubscriptionEvents);
//save history
- await newsLetterSubscription.SaveHistory<NewsLetterSubscription>(_historyService);
+ await _historyService.SaveObject(newsLetterSubscription);
//Publish event
await _mediator.EntityInserted(newsLetterSubscription);
@@ -109,8 +109,8 @@ public class NewsLetterSubscriptionService : INewsLetterSubscriptionService
await _subscriptionRepository.UpdateAsync(newsLetterSubscription);
//save history
- await newsLetterSubscription.SaveHistory<NewsLetterSubscription>(_historyService);
-
+ await _historyService.SaveObject(newsLetterSubscription);
+
//Publish the un/subscribe event
if (prevNewsLetterSubscription != null)
switch (newsLetterSubscription.Active)