title: Structuremap PerRequest lifecycle
body: <p>I want to inject an instance into structuremap on the fly (i.e. outside of a registry/configuration) that lives for the life of the request.</p>
  
  <p>Currently I'm doing this in the <code>HandleBeginRequest</code> event of an <code>IHttpModule</code>:</p>
  
  <pre><code>container.Configure(x =&gt; x.For&lt;IMyClass&gt;()
    .LifecycleIs(Lifecycles.GetLifecycle(InstanceScope.PerRequest))
    .Use(new MyClass()));
  </code></pre>
  
  <p>However, if at some point in the application's life I do:</p>
  
  <pre><code>ObjectFactory.WhatDoIHave();
  </code></pre>
  
  <p>I see as many configured instances for <code>IMyClass</code> as there have been requests (or at least a significant amount).</p>
  
  <p>Thinking about it, this sort of makes sense given the code I have.</p>
  
  <p>Is there a better way to inject an instance into the container just for the life of the current request in a way that doesn't pollute the whole container?</p>
  
  <p>Thanks</p>