title: Asp.net core DI with context
body: <p>I'm trying implement a simple dependency (in ASP.NET Core) as this:</p>
  
  <pre><code>public partial class BaseController : Controller
  {
      public new ITempDataDictionary TempData { get; private set; }
  
      public override void OnActionExecuting(ActionExecutingContext context)
      {
          base.OnActionExecuting(context);
  
          //preparação da tempdata
          this.TempData = new TempDataDictionary(HttpContext); //todo: DI?
          this.TempData.Load();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem is the fact <code>TempDataDictionary</code> depends of <code>HttpContext</code> present in this controller.
  How to implement that scenario in DI, since the <code>ServiceLocator</code> has no knowledge of <code>HttpContext</code> at Startup?</p>
  
  <p>As this?</p>
  
  <p>services.AddScoped(); //??????</p>
  
  <p>But where i fill the constructor parameter <code>HttpContext</code> if this present just in controller?</p>