Removing the temporary use of thread static

This commit is contained in:
Louis DeJardin 2014-03-19 00:02:58 -07:00
parent 951e8df893
commit ff19628832
1 changed files with 3 additions and 12 deletions

View File

@ -43,20 +43,13 @@ namespace Microsoft.AspNet.RequestContainer
_rootHttpContextAccessor.SetContextSource(AccessRootHttpContext, ExchangeRootHttpContext); _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() private HttpContext AccessRootHttpContext()
{ {
#if NET45 #if NET45
return CallContext.LogicalGetData(LogicalDataKey) as HttpContext; return CallContext.LogicalGetData(LogicalDataKey) as HttpContext;
#else #else
return THIS_IS_BROKEN_AND_MUST_BE_CHANGED; throw new Exception("TODO: CallContext not available");
#endif #endif
} }
private HttpContext ExchangeRootHttpContext(HttpContext httpContext) private HttpContext ExchangeRootHttpContext(HttpContext httpContext)
@ -66,9 +59,7 @@ namespace Microsoft.AspNet.RequestContainer
CallContext.LogicalSetData(LogicalDataKey, httpContext); CallContext.LogicalSetData(LogicalDataKey, httpContext);
return prior; return prior;
#else #else
var prior = THIS_IS_BROKEN_AND_MUST_BE_CHANGED; return null;
THIS_IS_BROKEN_AND_MUST_BE_CHANGED = httpContext;
return prior;
#endif #endif
} }