Skip to content

Commit

Permalink
Minor refactoring - move storage extensions to grand.web.common project
Browse files Browse the repository at this point in the history
  • Loading branch information
support committed Jun 13, 2022
1 parent fc0b66f commit 3d5d13d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
11 changes: 4 additions & 7 deletions src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down Expand Up @@ -35,8 +35,7 @@ public async Task<IActionResult> DownloadFile(Guid downloadGuid)
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
};
}
Expand All @@ -52,8 +51,7 @@ public async Task<IActionResult> SaveDownloadUrl(string downloadUrl)
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,
Expand Down Expand Up @@ -98,8 +96,7 @@ public virtual async Task<IActionResult> AsyncUpload()
fileExtension = fileExtension.ToLowerInvariant();


var download = new Download
{
var download = new Download {
DownloadGuid = Guid.NewGuid(),
UseDownloadUrl = false,
DownloadUrl = "",
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Grand.Web.Admin/Controllers/PictureController.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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;
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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Grand.Web/Controllers/CommonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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;
Expand All @@ -27,6 +26,7 @@
using Microsoft.AspNetCore.Mvc;
using System.Net;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Extensions;

namespace Grand.Web.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions src/Web/Grand.Web/Controllers/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;
using Grand.Web.Common.Extensions;

namespace Grand.Web.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions src/Web/Grand.Web/Controllers/ShoppingCartController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Grand.Web.Common.Extensions;

namespace Grand.Web.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions src/Web/Grand.Web/Controllers/VendorController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down

0 comments on commit 3d5d13d

Please sign in to comment.