title: Repository, IRepository and structuremap
body: <p>I have an interface IRepository and an implementation EFRepository.<br>
  I use structuremap injection in order to get the repository implementation.<br>
  Right now the EFRepository has constructor with no parameter so structuremap knows to retrieve instances on EFRepository easily.</p>
  
  <p>Now I need to change the repository implementation so that it will recieve in the constructor parameter that holds the unit of work.</p>
  
  <p>My question in such case, how I use structuremap in order to return an instance that initialized with the unit of work?</p>
  
  <p><strong>EXAMPLE</strong><br>
  Until today I used:</p>
  
  <pre><code>using(IUnitOfWork uow=UnitOfWork.current) {
      IRepository rep = ObjectFactory.GetInstance&lt;IRepository&lt;T&gt;&gt;();
      //repository operations that uses UnitOfWork.current that initialized above
  }// here dispose of UnitOfWork.current
  </code></pre>
  
  <p>Now I want to use:</p>
  
  <pre><code>using(IUnitOfWork uow=new UnitOfWork()) {
      //Not sure is this is how I tell sructure map to use contractor that 
      //get IUnitOfWork)    
      IRepository rep = ObjectFactory.GetInstance&lt;IRepository&lt;T&gt;&gt;(uow);
      //repository operations that uses uow that initialized above
  }// here dispose of UnitOfWork
  </code></pre>