Skip to content

Commit

Permalink
Some refactoring of CustomerController class
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshelev committed Mar 22, 2022
1 parent 26b0927 commit 87a794f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Presentation/Nop.Web/Controllers/CustomerController.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -55,9 +56,9 @@ public partial class CustomerController : BasePublicController
private readonly CaptchaSettings _captchaSettings;
private readonly CustomerSettings _customerSettings;
private readonly DateTimeSettings _dateTimeSettings;
private readonly IDownloadService _downloadService;
private readonly ForumSettings _forumSettings;
private readonly GdprSettings _gdprSettings;
private readonly HtmlEncoder _htmlEncoder;
private readonly IAddressAttributeParser _addressAttributeParser;
private readonly IAddressModelFactory _addressModelFactory;
private readonly IAddressService _addressService;
Expand All @@ -70,6 +71,7 @@ public partial class CustomerController : BasePublicController
private readonly ICustomerModelFactory _customerModelFactory;
private readonly ICustomerRegistrationService _customerRegistrationService;
private readonly ICustomerService _customerService;
private readonly IDownloadService _downloadService;
private readonly IEventPublisher _eventPublisher;
private readonly IExportManager _exportManager;
private readonly IExternalAuthenticationService _externalAuthenticationService;
Expand Down Expand Up @@ -104,9 +106,9 @@ public partial class CustomerController : BasePublicController
CaptchaSettings captchaSettings,
CustomerSettings customerSettings,
DateTimeSettings dateTimeSettings,
IDownloadService downloadService,
ForumSettings forumSettings,
GdprSettings gdprSettings,
HtmlEncoder htmlEncoder,
IAddressAttributeParser addressAttributeParser,
IAddressModelFactory addressModelFactory,
IAddressService addressService,
Expand All @@ -119,6 +121,7 @@ public partial class CustomerController : BasePublicController
ICustomerModelFactory customerModelFactory,
ICustomerRegistrationService customerRegistrationService,
ICustomerService customerService,
IDownloadService downloadService,
IEventPublisher eventPublisher,
IExportManager exportManager,
IExternalAuthenticationService externalAuthenticationService,
Expand Down Expand Up @@ -149,9 +152,9 @@ public partial class CustomerController : BasePublicController
_captchaSettings = captchaSettings;
_customerSettings = customerSettings;
_dateTimeSettings = dateTimeSettings;
_downloadService = downloadService;
_forumSettings = forumSettings;
_gdprSettings = gdprSettings;
_htmlEncoder = htmlEncoder;
_addressAttributeParser = addressAttributeParser;
_addressModelFactory = addressModelFactory;
_addressService = addressService;
Expand All @@ -164,6 +167,7 @@ public partial class CustomerController : BasePublicController
_customerModelFactory = customerModelFactory;
_customerRegistrationService = customerRegistrationService;
_customerService = customerService;
_downloadService = downloadService;
_eventPublisher = eventPublisher;
_exportManager = exportManager;
_externalAuthenticationService = externalAuthenticationService;
Expand Down Expand Up @@ -425,7 +429,7 @@ public virtual async Task<IActionResult> Login(bool? checkoutAsGuest)
{
var fullName = await _customerService.GetCustomerFullNameAsync(customer);
var message = await _localizationService.GetResourceAsync("Account.Login.AlreadyLogin");
_notificationService.SuccessNotification(string.Format(message, fullName));
_notificationService.SuccessNotification(string.Format(message, _htmlEncoder.Encode(fullName)));
}

return View(model);
Expand Down

0 comments on commit 87a794f

Please sign in to comment.