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.

Use ClearAsync from IRepository

KrzysztofPajak62995f34bd4c
diff --git a/src/Business/Grand.Business.Marketing/Services/Contacts/ContactUsService.cs b/src/Business/Grand.Business.Marketing/Services/Contacts/ContactUsService.cs
index 693592a84..ebe4247e0 100644
--- a/src/Business/Grand.Business.Marketing/Services/Contacts/ContactUsService.cs
+++ b/src/Business/Grand.Business.Marketing/Services/Contacts/ContactUsService.cs
@@ -47,7 +47,7 @@ namespace Grand.Business.Marketing.Services.Contacts
/// </summary>
public virtual async Task ClearTable()
{
- await _contactusRepository.Collection.DeleteManyAsync(new MongoDB.Bson.BsonDocument());
+ await _contactusRepository.ClearAsync();
}
/// <summary>
diff --git a/src/Business/Grand.Business.Messages/Services/QueuedEmailService.cs b/src/Business/Grand.Business.Messages/Services/QueuedEmailService.cs
index 6830b5ae9..45c9716b4 100644
--- a/src/Business/Grand.Business.Messages/Services/QueuedEmailService.cs
+++ b/src/Business/Grand.Business.Messages/Services/QueuedEmailService.cs
@@ -187,7 +187,7 @@ namespace Grand.Business.Messages.Services
/// </summary>
public virtual async Task DeleteAllEmails()
{
- await _queuedEmailRepository.Collection.DeleteManyAsync(new MongoDB.Bson.BsonDocument());
+ await _queuedEmailRepository.ClearAsync();
}
}
}
diff --git a/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.cs
index 9e529283a..97e73f6cf 100644
--- a/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.cs
+++ b/src/Business/Grand.Business.System/Commands/Handlers/Common/DeleteActivitylogCommandHandler.cs
@@ -19,7 +19,7 @@ namespace Grand.Business.System.Commands.Handlers.Common
public async Task<bool> Handle(DeleteActivitylogCommand request, CancellationToken cancellationToken)
{
- await _repositoryActivityLog.Collection.DeleteManyAsync(new BsonDocument());
+ await _repositoryActivityLog.ClearAsync();
return true;
}
}