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.

Minor refactoring - move storage extensions to grand.web.common project

support3d5d13d23804
diff --git a/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj b/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj
index 7ff7d3898..086eab23d 100644
--- a/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj
+++ b/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj
@@ -14,12 +14,12 @@
<OutDir>$(OutputPath)</OutDir>
</PropertyGroup>
- <Target Name="PostBuild" AfterTargets="PostBuildEvent">
- <RemoveDir Directories="..\..\Web\Grand.Web\Plugins\Authentication.Facebook\refs" />
- <RemoveDir Directories="..\..\Web\Grand.Web\Plugins\Authentication.Facebook\ref" />
- </Target>
+ <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+ <RemoveDir Directories="..\..\Web\Grand.Web\Plugins\Authentication.Facebook\refs" />
+ <RemoveDir Directories="..\..\Web\Grand.Web\Plugins\Authentication.Facebook\ref" />
+ </Target>
- <ItemGroup>
+ <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="6.0.4" />
</ItemGroup>
diff --git a/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs b/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
index bfb191af7..4f18e0c94 100644
--- a/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Utilities.Common.Security;
-using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Web.Common.Security.Authorization;
using Grand.Domain.Media;
using Grand.Web.Admin.Extensions;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.Common.Extensions;
namespace Grand.Web.Admin.Controllers
{
@@ -35,8 +35,7 @@ namespace Grand.Web.Admin.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
};
}
@@ -52,8 +51,7 @@ namespace Grand.Web.Admin.Controllers
return Json(new { success = false, error = "URL can't be empty" });
}
//insert
- var download = new Download
- {
+ var download = new Download {
DownloadGuid = Guid.NewGuid(),
UseDownloadUrl = true,
DownloadUrl = downloadUrl,
@@ -98,8 +96,7 @@ namespace Grand.Web.Admin.Controllers
fileExtension = fileExtension.ToLowerInvariant();
- var download = new Download
- {
+ var download = new Download {
DownloadGuid = Guid.NewGuid(),
UseDownloadUrl = false,
DownloadUrl = "",
diff --git a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
index c791ea8f4..37ad21c58 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
@@ -1,6 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Utilities.Common.Security;
-using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Common;
using Grand.Domain.Media;
@@ -8,6 +7,7 @@ using Grand.Web.Admin.Extensions;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;
+using Grand.Web.Common.Extensions;
namespace Grand.Web.Admin.Controllers
{
diff --git a/src/Business/Grand.Business.Core/Extensions/StorageExtensions.cs b/src/Web/Grand.Web.Common/Extensions/StorageExtensions.cs
similarity index 93%
rename from src/Business/Grand.Business.Core/Extensions/StorageExtensions.cs
rename to src/Web/Grand.Web.Common/Extensions/StorageExtensions.cs
index 2b3f8d025..ea5e80657 100644
--- a/src/Business/Grand.Business.Core/Extensions/StorageExtensions.cs
+++ b/src/Web/Grand.Web.Common/Extensions/StorageExtensions.cs
@@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Http;
-namespace Grand.Business.Core.Extensions
+namespace Grand.Web.Common.Extensions
{
/// <summary>
- /// Extensions
+ /// Storage extensions
/// </summary>
public static class Extensions
{
diff --git a/src/Web/Grand.Web/Controllers/CommonController.cs b/src/Web/Grand.Web/Controllers/CommonController.cs
index 45befed69..d08c45688 100644
--- a/src/Web/Grand.Web/Controllers/CommonController.cs
+++ b/src/Web/Grand.Web/Controllers/CommonController.cs
@@ -3,7 +3,6 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
-using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Captcha;
@@ -27,6 +26,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Net;
using Grand.Web.Common.Controllers;
+using Grand.Web.Common.Extensions;
namespace Grand.Web.Controllers
{
diff --git a/src/Web/Grand.Web/Controllers/ProductController.cs b/src/Web/Grand.Web/Controllers/ProductController.cs
index 93d682389..e771b69fb 100644
--- a/src/Web/Grand.Web/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web/Controllers/ProductController.cs
@@ -25,6 +25,7 @@ using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;
+using Grand.Web.Common.Extensions;
namespace Grand.Web.Controllers
{
diff --git a/src/Web/Grand.Web/Controllers/ShoppingCartController.cs b/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
index 69815cf37..1d3b9b341 100644
--- a/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
+++ b/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
@@ -22,6 +22,7 @@ using Grand.Web.Features.Models.ShoppingCart;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.Common.Extensions;
namespace Grand.Web.Controllers
{
diff --git a/src/Web/Grand.Web/Controllers/VendorController.cs b/src/Web/Grand.Web/Controllers/VendorController.cs
index 137630389..0a79b1ed8 100644
--- a/src/Web/Grand.Web/Controllers/VendorController.cs
+++ b/src/Web/Grand.Web/Controllers/VendorController.cs
@@ -12,6 +12,7 @@ using Grand.Domain.Vendors;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
using Grand.Web.Commands.Models.Vendors;
+using Grand.Web.Common.Extensions;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Captcha;
using Grand.Web.Extensions;