title: How to get rid of ObjectFactory in code using StructureMap
body: <p>After upgrading our solution using the latest StructureMap version (3.1.6.191) I got a lot of obsolete warnings. These warnings come from StructureMap where the <code>ObjectFactory</code> class will be deprecated in future releases (4.0+).</p>
  
  <p>I am using WCF and we want to let StructureMap hook in the WCF pipeline using an implementation of the <code>IInstanceProvider</code>:</p>
  
  <pre><code>public class StructureMapInstanceProvider : IInstanceProvider
  </code></pre>
  
  <p>This class uses the <code>ObjectFactory</code> to get an instance, how can we get an instance of a type when there is no static class anymore of my container to resolve it ?</p>