From ff1962883240d942ced116e8c42950317fbd93b3 Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Wed, 19 Mar 2014 00:02:58 -0700 Subject: [PATCH] Removing the temporary use of thread static --- .../ContainerMiddleware.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.AspNet.RequestContainer/ContainerMiddleware.cs b/src/Microsoft.AspNet.RequestContainer/ContainerMiddleware.cs index a33a6ac7db..61d985fc3d 100644 --- a/src/Microsoft.AspNet.RequestContainer/ContainerMiddleware.cs +++ b/src/Microsoft.AspNet.RequestContainer/ContainerMiddleware.cs @@ -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 }