mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 18:27:55 +08:00
Merge pull request #6370 from jtkech/patch-10
New IsBackgroundHttpContext() extension helper.
This commit is contained in:
@@ -6,4 +6,10 @@ namespace Orchard.Mvc.Extensions {
|
||||
return httpContextBase == null || httpContextBase is MvcModule.HttpContextPlaceholder;
|
||||
}
|
||||
}
|
||||
|
||||
public static class HttpContextExtensions {
|
||||
public static bool IsBackgroundHttpContext(this HttpContext httpContext) {
|
||||
return HttpContextAccessor.IsBackgroundHttpContext(httpContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ namespace Orchard.Mvc {
|
||||
_httpContext = httpContext;
|
||||
}
|
||||
|
||||
private static bool IsBackgroundHttpContext(HttpContext httpContext) {
|
||||
internal static bool IsBackgroundHttpContext(HttpContext httpContext) {
|
||||
return httpContext == null || httpContext.Items.Contains(MvcModule.IsBackgroundHttpContextKey);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user