Removing the temporary use of thread static
This commit is contained in:
parent
951e8df893
commit
ff19628832
|
|
@ -43,20 +43,13 @@ namespace Microsoft.AspNet.RequestContainer
|
|||
_rootHttpContextAccessor.SetContextSource(AccessRootHttpContext, ExchangeRootHttpContext);
|
||||
}
|
||||
|
||||
#if NET45
|
||||
#else
|
||||
#warning This MUST NOT be ThreadStatic in reality
|
||||
[ThreadStatic]
|
||||
HttpContext THIS_IS_BROKEN_AND_MUST_BE_CHANGED;
|
||||
#endif
|
||||
|
||||
private HttpContext AccessRootHttpContext()
|
||||
{
|
||||
#if NET45
|
||||
return CallContext.LogicalGetData(LogicalDataKey) as HttpContext;
|
||||
#else
|
||||
return THIS_IS_BROKEN_AND_MUST_BE_CHANGED;
|
||||
#endif
|
||||
throw new Exception("TODO: CallContext not available");
|
||||
#endif
|
||||
}
|
||||
|
||||
private HttpContext ExchangeRootHttpContext(HttpContext httpContext)
|
||||
|
|
@ -66,9 +59,7 @@ namespace Microsoft.AspNet.RequestContainer
|
|||
CallContext.LogicalSetData(LogicalDataKey, httpContext);
|
||||
return prior;
|
||||
#else
|
||||
var prior = THIS_IS_BROKEN_AND_MUST_BE_CHANGED;
|
||||
THIS_IS_BROKEN_AND_MUST_BE_CHANGED = httpContext;
|
||||
return prior;
|
||||
return null;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue