Refactoring
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Core.WebAssets;
|
||||
using Umbraco.Web.BackOffice.Controllers;
|
||||
using Umbraco.Web.Common.ActionResults;
|
||||
|
||||
namespace Umbraco.Web.BackOffice.Filters
|
||||
@@ -14,10 +12,11 @@ namespace Umbraco.Web.BackOffice.Filters
|
||||
public override async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
|
||||
{
|
||||
// logic before action goes here
|
||||
var hostingEnvironment = context.HttpContext.RequestServices.GetService<IHostingEnvironment>();
|
||||
var serviceProvider = context.HttpContext.RequestServices;
|
||||
var hostingEnvironment = serviceProvider.GetService<IHostingEnvironment>();
|
||||
if (!hostingEnvironment.IsDebugMode)
|
||||
{
|
||||
var runtimeMinifier = context.HttpContext.RequestServices.GetService<IRuntimeMinifier>();
|
||||
var runtimeMinifier = serviceProvider.GetService<IRuntimeMinifier>();
|
||||
|
||||
if (context.Result is JavaScriptResult jsResult)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user