title: Reference to StructureMap container in concrete type
body: <p>I'm designing a simple aspects framework using the DynamicProxy stuff and StructureMap and I've run up against an issue. I have the following method in my Registry:</p>
  
  <pre><code>public T AddAspectsTo&lt;T&gt;(T concreteObject)
  {
      ProxyGenerator dynamicProxy = new ProxyGenerator();
      return (T)dynamicProxy.CreateInterfaceProxyWithTargetInterface(typeof(T)
      ,concreteObject,
      new[] { (IInterceptor)new AspectInterceptor(attributeMap) });
  }
  </code></pre>
  
  <p>Which allows me to write code like:</p>
  
  <pre><code>For&lt;ITestClass&gt;().Use&lt;TestClass&gt;().EnrichWith(AddAspectsTo&lt;ITestClass&gt;);
  </code></pre>
  
  <p>The important thing is that I'm creating a concrete version of AspectInterceptor. In that class I need to grab items from the IoC container, but at this point I don't know about the IContainer object.</p>
  
  <p>I won't need access to the IoC container until the resulting ITestClasses are in use and so the IContainer will have been created, but can't figure out how to grab the instance?</p>
  
  <p>To be clear, I'm talking about cases here where we setup the structuremap container with:</p>
  
  <pre><code>IContainer container = new Container(new ItemWithPropertiesRegistry());
  </code></pre>
  
  <p>rather than the standard ObjectFactory stuff, which  works fine.</p>