title: AddTransient service using info from request
body: <p>I've got an app in asp.net core using the built-in DI framework. I'd like to add a per-request (i.e. transient) service to the provider, but I'd like to actually make use of the request in its construction.</p>
  
  <pre><code>services.AddTransient&lt;IMyService&gt;(provider =&gt; { ... });
  </code></pre>
  
  <p>That's the closest overload I can find, but the <code>provider</code> object doesn't have anything about the current request. Is there a way to achieve what I'm trying to do, without upgrading to a more robust DI framework?</p>