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.

Remove unused using

KrzysztofPajakea2ed7c490d8
diff --git a/src/Web/Grand.Web/Commands/Handler/Orders/MerchandiseReturnSubmitCommandHandler.cs b/src/Web/Grand.Web/Commands/Handler/Orders/MerchandiseReturnSubmitCommandHandler.cs
index b4b243ae8..db8f0e0aa 100644
--- a/src/Web/Grand.Web/Commands/Handler/Orders/MerchandiseReturnSubmitCommandHandler.cs
+++ b/src/Web/Grand.Web/Commands/Handler/Orders/MerchandiseReturnSubmitCommandHandler.cs
@@ -1,12 +1,12 @@
using Grand.Business.Catalog.Interfaces.Products;
using Grand.Business.Checkout.Interfaces.Orders;
using Grand.Business.Common.Extensions;
+using Grand.Business.Common.Interfaces.Directory;
using Grand.Business.Common.Interfaces.Localization;
using Grand.Business.Messages.Interfaces;
-using Grand.Infrastructure;
-using Grand.Domain.Customers;
using Grand.Domain.Localization;
using Grand.Domain.Orders;
+using Grand.Infrastructure;
using Grand.Web.Commands.Models.Orders;
using Grand.Web.Models.Orders;
using MediatR;
@@ -15,7 +15,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using Grand.Business.Common.Interfaces.Directory;
namespace Grand.Web.Commands.Handler.Orders
{
@@ -49,8 +48,7 @@ namespace Grand.Web.Commands.Handler.Orders
public async Task<(MerchandiseReturnModel model, MerchandiseReturn rr)> Handle(MerchandiseReturnSubmitCommand request, CancellationToken cancellationToken)
{
- var rr = new MerchandiseReturn
- {
+ var rr = new MerchandiseReturn {
StoreId = _workContext.CurrentStore.Id,
OrderId = request.Order.Id,
CustomerId = _workContext.CurrentCustomer.Id,
@@ -98,8 +96,7 @@ namespace Grand.Web.Commands.Handler.Orders
{
var rrr = await _merchandiseReturnService.GetMerchandiseReturnReasonById(rrrId);
var rra = await _merchandiseReturnService.GetMerchandiseReturnActionById(rraId);
- rr.MerchandiseReturnItems.Add(new MerchandiseReturnItem
- {
+ rr.MerchandiseReturnItems.Add(new MerchandiseReturnItem {
RequestedAction = rra != null ? rra.GetTranslation(x => x.Name, _workContext.WorkingLanguage.Id) : "not available",
ReasonForReturn = rrr != null ? rrr.GetTranslation(x => x.Name, _workContext.WorkingLanguage.Id) : "not available",
Quantity = quantity,
diff --git a/src/Web/Grand.Web/Controllers/BlogController.cs b/src/Web/Grand.Web/Controllers/BlogController.cs
index 7a290c2d9..08bc8f0eb 100644
--- a/src/Web/Grand.Web/Controllers/BlogController.cs
+++ b/src/Web/Grand.Web/Controllers/BlogController.cs
@@ -7,7 +7,6 @@ using Grand.Business.Common.Services.Security;
using Grand.Domain.Blogs;
using Grand.Infrastructure;
using Grand.Web.Commands.Models.Blogs;
-using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Captcha;
using Grand.Web.Events;
diff --git a/src/Web/Grand.Web/Controllers/CourseController.cs b/src/Web/Grand.Web/Controllers/CourseController.cs
index 5183bcac5..494fec033 100644
--- a/src/Web/Grand.Web/Controllers/CourseController.cs
+++ b/src/Web/Grand.Web/Controllers/CourseController.cs
@@ -2,7 +2,6 @@
using Grand.Business.Common.Interfaces.Localization;
using Grand.Business.Common.Interfaces.Logging;
using Grand.Business.Common.Interfaces.Security;
-using Grand.Business.Common.Interfaces.Stores;
using Grand.Business.Common.Services.Security;
using Grand.Business.Marketing.Interfaces.Courses;
using Grand.Business.Marketing.Interfaces.Customers;
@@ -120,8 +119,7 @@ namespace Grand.Web.Controllers
await _customerActionEventService.Viewed(customer, HttpContext.Request.Path.ToString(), Request.Headers[HeaderNames.Referer].ToString() != null ? Request.Headers["Referer"].ToString() : "");
//model
- var model = await _mediator.Send(new GetCourse()
- {
+ var model = await _mediator.Send(new GetCourse() {
Course = course,
Customer = _workContext.CurrentCustomer,
Language = _workContext.WorkingLanguage
@@ -158,8 +156,7 @@ namespace Grand.Web.Controllers
await _customerActionEventService.Viewed(customer, HttpContext.Request.Path.ToString(), Request.Headers[HeaderNames.Referer].ToString() != null ? Request.Headers["Referer"].ToString() : "");
//model
- var model = await _mediator.Send(new GetLesson()
- {
+ var model = await _mediator.Send(new GetLesson() {
Course = course,
Customer = _workContext.CurrentCustomer,
Language = _workContext.WorkingLanguage,
@@ -198,8 +195,7 @@ namespace Grand.Web.Controllers
string contentType = !string.IsNullOrWhiteSpace(download.ContentType)
? download.ContentType
: "application/octet-stream";
- return new FileContentResult(download.DownloadBinary, contentType)
- {
+ return new FileContentResult(download.DownloadBinary, contentType) {
FileDownloadName = fileName + download.Extension
};
}
@@ -234,8 +230,7 @@ namespace Grand.Web.Controllers
string contentType = !string.IsNullOrWhiteSpace(download.ContentType)
? download.ContentType
: "video/mp4";
- return new FileContentResult(download.DownloadBinary, contentType)
- {
+ return new FileContentResult(download.DownloadBinary, contentType) {
FileDownloadName = fileName + download.Extension
};
}
diff --git a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
index 9beb287d8..8cd928413 100644
--- a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
+++ b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
@@ -13,7 +13,6 @@ using Grand.Domain.Knowledgebase;
using Grand.Domain.Localization;
using Grand.Infrastructure;
using Grand.Infrastructure.Caching;
-using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Captcha;
using Grand.Web.Events.Cache;
@@ -93,8 +92,7 @@ namespace Grand.Web.Controllers
var model = new KnowledgebaseHomePageModel();
var articles = await _knowledgebaseService.GetPublicKnowledgebaseArticlesByCategory(categoryId);
var allCategories = _knowledgebaseService.GetPublicKnowledgebaseCategories();
- articles.ForEach(x => model.Items.Add(new KnowledgebaseItemModel
- {
+ articles.ForEach(x => model.Items.Add(new KnowledgebaseItemModel {
Name = x.GetTranslation(y => y.Name, _workContext.WorkingLanguage.Id),
Id = x.Id,
SeName = x.GetTranslation(y => y.SeName, _workContext.WorkingLanguage.Id),
@@ -119,8 +117,7 @@ namespace Grand.Web.Controllers
string.Join(",", _workContext.CurrentCustomer.GetCustomerGroupIds()), _workContext.CurrentStore.Id, _workContext.WorkingLanguage.Id);
model.CategoryBreadcrumb = await _cacheBase.GetAsync(breadcrumbCacheKey, async () =>
(await category.GetCategoryBreadCrumb(_knowledgebaseService, _aclService, _workContext))
- .Select(catBr => new KnowledgebaseCategoryModel
- {
+ .Select(catBr => new KnowledgebaseCategoryModel {
Id = catBr.Id,
Name = catBr.GetTranslation(x => x.Name, _workContext.WorkingLanguage.Id),
SeName = catBr.GetSeName(_workContext.WorkingLanguage.Id)
@@ -142,8 +139,7 @@ namespace Grand.Web.Controllers
{
var categories = await _knowledgebaseService.GetPublicKnowledgebaseCategoriesByKeyword(keyword);
var allCategories = await _knowledgebaseService.GetPublicKnowledgebaseCategories();
- categories.ForEach(x => model.Items.Add(new KnowledgebaseItemModel
- {
+ categories.ForEach(x => model.Items.Add(new KnowledgebaseItemModel {
Name = x.GetTranslation(y => y.Name, _workContext.WorkingLanguage.Id),
Id = x.Id,
SeName = x.GetTranslation(y => y.SeName, _workContext.WorkingLanguage.Id),
@@ -154,8 +150,7 @@ namespace Grand.Web.Controllers
var articles = await _knowledgebaseService.GetPublicKnowledgebaseArticlesByKeyword(keyword);
foreach (var item in articles)
{
- var kbm = new KnowledgebaseItemModel
- {
+ var kbm = new KnowledgebaseItemModel {
Name = item.GetTranslation(y => y.Name, _workContext.WorkingLanguage.Id),
Id = item.Id,
SeName = item.GetTranslation(y => y.SeName, _workContext.WorkingLanguage.Id),
@@ -218,8 +213,7 @@ namespace Grand.Web.Controllers
foreach (var ac in articleComments)
{
var customer = await customerService.GetCustomerById(ac.CustomerId);
- var commentModel = new KnowledgebaseArticleCommentModel
- {
+ var commentModel = new KnowledgebaseArticleCommentModel {
Id = ac.Id,
CustomerId = ac.CustomerId,
CustomerName = customer.FormatUserName(_customerSettings.CustomerNameFormat),
@@ -233,8 +227,7 @@ namespace Grand.Web.Controllers
{
var a = await _knowledgebaseService.GetPublicKnowledgebaseArticle(id);
if (a != null)
- model.RelatedArticles.Add(new KnowledgebaseArticleModel
- {
+ model.RelatedArticles.Add(new KnowledgebaseArticleModel {
SeName = a.SeName,
Id = a.Id,
Name = a.Name
@@ -251,8 +244,7 @@ namespace Grand.Web.Controllers
_workContext.WorkingLanguage.Id);
model.CategoryBreadcrumb = await _cacheBase.GetAsync(breadcrumbCacheKey, async () =>
(await category.GetCategoryBreadCrumb(_knowledgebaseService, _aclService, _workContext))
- .Select(catBr => new KnowledgebaseCategoryModel
- {
+ .Select(catBr => new KnowledgebaseCategoryModel {
Id = catBr.Id,
Name = catBr.GetTranslation(x => x.Name, _workContext.WorkingLanguage.Id),
SeName = catBr.GetSeName(_workContext.WorkingLanguage.Id)
@@ -291,8 +283,7 @@ namespace Grand.Web.Controllers
if (ModelState.IsValid)
{
var customer = _workContext.CurrentCustomer;
- var comment = new KnowledgebaseArticleComment
- {
+ var comment = new KnowledgebaseArticleComment {
ArticleId = article.Id,
CustomerId = customer.Id,
CommentText = model.AddNewComment.CommentText,
diff --git a/src/Web/Grand.Web/Controllers/LetsEncryptController.cs b/src/Web/Grand.Web/Controllers/LetsEncryptController.cs
index 543a6f4c0..1cd86d0fc 100644
--- a/src/Web/Grand.Web/Controllers/LetsEncryptController.cs
+++ b/src/Web/Grand.Web/Controllers/LetsEncryptController.cs
@@ -1,16 +1,15 @@
-using Grand.Infrastructure;
+using Grand.Business.Storage.Interfaces;
using Grand.Domain.Common;
-using Grand.SharedKernel.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.IO;
-using Grand.Business.Storage.Interfaces;
using System.Threading.Tasks;
namespace Grand.Web.Controllers
{
[AllowAnonymous]
public partial class LetsEncryptController : Controller
+ public partial class LetsEncryptController : Controller
{
private readonly CommonSettings _commonSettings;
private readonly IMediaFileStore _mediaFileStore;
diff --git a/src/Web/Grand.Web/Controllers/OutOfStockSubscriptionController.cs b/src/Web/Grand.Web/Controllers/OutOfStockSubscriptionController.cs
index 66c0fad93..800ef2a13 100644
--- a/src/Web/Grand.Web/Controllers/OutOfStockSubscriptionController.cs
+++ b/src/Web/Grand.Web/Controllers/OutOfStockSubscriptionController.cs
@@ -1,21 +1,19 @@
-using Grand.Business.Catalog.Extensions;
-using Grand.Business.Catalog.Interfaces.Products;
+using Grand.Business.Catalog.Interfaces.Products;
using Grand.Business.Common.Extensions;
+using Grand.Business.Common.Interfaces.Directory;
using Grand.Business.Common.Interfaces.Localization;
-using Grand.Infrastructure;
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
using Grand.Domain.Orders;
+using Grand.Infrastructure;
using Grand.Web.Features.Models.ShoppingCart;
using Grand.Web.Models.Catalog;
-using Grand.Web.Models.Common;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using System.Threading.Tasks;
-using Grand.Business.Common.Interfaces.Directory;
namespace Grand.Web.Controllers
{
@@ -139,8 +137,7 @@ namespace Grand.Web.Controllers
//subscription does not exist
//subscribe
- subscription = new OutOfStockSubscription
- {
+ subscription = new OutOfStockSubscription {
CustomerId = customer.Id,
ProductId = product.Id,
StoreId = _workContext.CurrentStore.Id,
@@ -179,9 +176,8 @@ namespace Grand.Web.Controllers
//subscription does not exist
//subscribe
-
- subscription = new OutOfStockSubscription
- {
+
+ subscription = new OutOfStockSubscription {
CustomerId = customer.Id,
ProductId = product.Id,
Attributes = attributes,
@@ -235,8 +231,7 @@ namespace Grand.Web.Controllers
var product = await _productService.GetProductById(subscription.ProductId);
if (product != null)
{
- var subscriptionModel = new CustomerOutOfStockSubscriptionsModel.OutOfStockSubscriptionModel
- {
+ var subscriptionModel = new CustomerOutOfStockSubscriptionsModel.OutOfStockSubscriptionModel {
Id = subscription.Id,
ProductId = product.Id,
ProductName = product.GetTranslation(x => x.Name, _workContext.WorkingLanguage.Id),