title: AsyncLocal<T> doesn't reach controllers
body: <p>I don't quite fully understand this situation, where AsyncLocal <a href="https://github.com/dmumladze/WebApp/blob/master/WebApp/Models/DomainContextAccessor.cs" rel="nofollow noreferrer">instance</a> is set at a certain point in the <a href="https://github.com/dmumladze/WebApp/blob/master/WebApp/Security/UserAuthenticationHandler.cs#L36" rel="nofollow noreferrer">AuthenticationHandler</a>, but does not reach the controller, when it is injected into the <a href="https://github.com/dmumladze/WebApp/blob/master/WebApp/Controllers/WeatherController.cs#L20" rel="nofollow noreferrer">constructor</a>.</p>
  <p>I've made it similar to how <a href="https://github.com/dotnet/aspnetcore/blob/5116838807783a5beaf76a8a12e5faedb15a4f2d/src/Http/Http/src/HttpContextAccessor.cs" rel="nofollow noreferrer">IHttpContextAccessor</a> works, but still nowhere near. However, if I set the AsyncLocal from a <a href="https://github.com/dmumladze/WebApp/blob/master/WebApp/Middleware/DomainContextMiddleware.cs#L23" rel="nofollow noreferrer">Middleware</a>, it reaches the controller. Also, setting the HttpContext.Items property from <a href="https://github.com/dmumladze/WebApp/blob/master/WebApp/Security/UserAuthenticationHandler.cs#L39" rel="nofollow noreferrer">AuthenticationHandler</a> works just fine.</p>
  <p>Question: How is HttpContext able to retain Items property contents all the way, and is ASP.NET runtime disposing the captured ExecutionContext of my DomainContextAccessor for some security reason because of where it is being set at?</p>
  <p>I've made a <a href="https://github.com/dmumladze/WebApp" rel="nofollow noreferrer">sample app</a> to demo this use case. I'd really appreciate someone shedding the light on this problem.</p>