Merge pull request #6370 from jtkech/patch-10

New IsBackgroundHttpContext() extension helper.
This commit is contained in:
Sébastien Ros
2016-02-18 12:39:08 -08:00
2 changed files with 7 additions and 1 deletions

View File

@@ -6,4 +6,10 @@ namespace Orchard.Mvc.Extensions {
return httpContextBase == null || httpContextBase is MvcModule.HttpContextPlaceholder; return httpContextBase == null || httpContextBase is MvcModule.HttpContextPlaceholder;
} }
} }
public static class HttpContextExtensions {
public static bool IsBackgroundHttpContext(this HttpContext httpContext) {
return HttpContextAccessor.IsBackgroundHttpContext(httpContext);
}
}
} }

View File

@@ -32,7 +32,7 @@ namespace Orchard.Mvc {
_httpContext = httpContext; _httpContext = httpContext;
} }
private static bool IsBackgroundHttpContext(HttpContext httpContext) { internal static bool IsBackgroundHttpContext(HttpContext httpContext) {
return httpContext == null || httpContext.Items.Contains(MvcModule.IsBackgroundHttpContextKey); return httpContext == null || httpContext.Items.Contains(MvcModule.IsBackgroundHttpContextKey);
} }