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.

Move CustomerEventsExtensions to the Core project

support599f44b2e6a7
diff --git a/src/Business/Grand.Business.Customers/Extensions/NotificationsExtensions.cs b/src/Business/Grand.Business.Core/Extensions/CustomerEventsExtensions.cs
similarity index 82%
rename from src/Business/Grand.Business.Customers/Extensions/NotificationsExtensions.cs
rename to src/Business/Grand.Business.Core/Extensions/CustomerEventsExtensions.cs
index 60cf909c0..a4462d934 100644
--- a/src/Business/Grand.Business.Customers/Extensions/NotificationsExtensions.cs
+++ b/src/Business/Grand.Business.Core/Extensions/CustomerEventsExtensions.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Utilities.Customers;
using MediatR;
-namespace Grand.Business.Customers.Extensions
+namespace Grand.Business.Core.Extensions
{
- public static class EventsExtensions
+ public static class CustomerEventsExtensions
{
public static async Task CustomerRegistrationEvent<C, R>(this IMediator eventPublisher, C result, R request)
where C : RegistrationResult where R : RegistrationRequest
diff --git a/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs b/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs
index cc3816016..3d7f639ac 100644
--- a/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs
+++ b/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs
@@ -1,7 +1,7 @@
+using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Customers.Extensions;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Utilities.Customers;
using Grand.Domain.Common;
@@ -68,8 +68,7 @@ namespace Grand.Business.Customers.Services
protected bool PasswordMatch(CustomerHistoryPassword customerPassword, ChangePasswordRequest request)
{
- string newPwd = request.PasswordFormat switch
- {
+ string newPwd = request.PasswordFormat switch {
PasswordFormat.Clear => request.NewPassword,
PasswordFormat.Encrypted => _encryptionService.EncryptText(request.NewPassword, customerPassword.PasswordSalt),
PasswordFormat.Hashed => _encryptionService.CreatePasswordHash(request.NewPassword, customerPassword.PasswordSalt, _customerSettings.HashedPasswordFormat),
@@ -103,8 +102,7 @@ namespace Grand.Business.Customers.Services
if (string.IsNullOrEmpty(password))
return CustomerLoginResults.WrongPassword;
- string pwd = customer.PasswordFormatId switch
- {
+ string pwd = customer.PasswordFormatId switch {
PasswordFormat.Clear => password,
PasswordFormat.Encrypted => _encryptionService.EncryptText(password, customer.PasswordSalt),
PasswordFormat.Hashed => _encryptionService.CreatePasswordHash(password, customer.PasswordSalt, _customerSettings.HashedPasswordFormat),
@@ -153,7 +151,7 @@ namespace Grand.Business.Customers.Services
throw new ArgumentException("Can't load current customer");
var result = new RegistrationResult();
-
+
if (await _groupService.IsRegistered(request.Customer))
{
result.AddError("Current customer is already registered");
@@ -368,7 +366,7 @@ namespace Grand.Business.Customers.Services
throw new GrandException("Email cannot be null");
newEmail = newEmail.Trim();
-
+
if (!CommonHelper.IsValidEmail(newEmail))
throw new GrandException(_translationService.GetResource("Account.EmailUsernameErrors.NewEmailIsNotValid"));