mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Update WorkContextAccessor.cs
This commit is contained in:
@@ -27,7 +27,11 @@ namespace Orchard.Environment {
|
||||
}
|
||||
|
||||
public WorkContext GetContext(HttpContextBase httpContext) {
|
||||
return httpContext.Items[_workContextKey] as WorkContext;
|
||||
if (!httpContext.IsBackgroundContext())
|
||||
return httpContext.Items[_workContextKey] as WorkContext;
|
||||
|
||||
WorkContext workContext;
|
||||
return EnsureThreadStaticContexts().TryGetValue(_workContextKey, out workContext) ? workContext : null;
|
||||
}
|
||||
|
||||
public WorkContext GetContext() {
|
||||
|
Reference in New Issue
Block a user