title: 'StructureMap.ObjectFactory' is obsolete
body: <p>I implemented a interface injection using StructureMap as describe below.</p>
  
  <pre><code>ObjectFactory.Initialize(x =&gt; { x.For&lt;*IRepository*&gt;().Use&lt;*SQLRepository*&gt;(); });
  </code></pre>
  
  <p>But it is giving a warning as follows</p>
  
  <blockquote>
    <p>Warning   2   'StructureMap.ObjectFactory' is obsolete: 'ObjectFactory will be removed in a future 4.0 release of StructureMap. Favor the usage of the Container class for future work'.</p>
  </blockquote>
  
  <p>How do I correct this by using  Container class</p>