title: How to use Unity to resolve a new instance every time the old one get disposed
body: <p>Im trying to start to use Unity but i got stock in a point.</p>
  
  <p>I have a Context class and a Repository class being resolved by the container.
  My Repository class take a Context ctor parameter as a Dependency.</p>
  
  <p>My Config file:</p>
  
  <p></p>
  
  <p>container:</p>
  
  <pre><code>  &lt;register type="IGeneralContext" mapTo="Data.EF.EFContext, Data.EF"&gt;
      &lt;lifetime type="singleton" /&gt;
      &lt;constructor&gt;
        &lt;param name="connectionString"&gt;
          &lt;value value="anyConnStr"/&gt;
        &lt;/param&gt;
      &lt;/constructor&gt;
    &lt;/register&gt;
  
    &lt;register type="IClienteRepository" mapTo="Repository.EF.ClientRepository, Repository.EF"&gt;
      &lt;constructor&gt;
        &lt;param name="context"&gt;
          &lt;dependency type="Data.EF.EFContext, Data.EF"/&gt;
        &lt;/param&gt;
      &lt;/constructor&gt;
    &lt;/register&gt;
  </code></pre>
  
  <p>And now, I want that a new instance of IGeneralContext get constructed when Resolve is called AND the old one was already released.</p>
  
  <p>See:</p>
  
  <pre><code>using (IGeneralContext context = container.Resolve&lt;IGeneralContext&gt;()) //NEW CONTEXT INSTANCE
  {
      IClienteRepository rep = container.Resolve&lt;IClienteRepository&gt;(); // USE DEPENDENCY AS SINGLETON
      Cliente nc = new Cliente() {  };
      rep.Add(nc);
      context.CommitChanges();
  } // DISPOSE CONTEXT
  
  using (IGeneralContext context = container.Resolve&lt;IGeneralContext&gt;()) //BRAND NEW CONTEXT INSTANCE
  {
      IClienteRepository rep = container.Resolve&lt;IClienteRepository&gt;(); // USE DEPENDENCY AS SINGLETON
      Cliente nc = new Cliente() { };
      rep.Add(nc);
      context.CommitChanges();
  } // DISPOSE CONTEXT
  
  IClienteRepository rep1 = container.Resolve&lt;IClienteRepository&gt;(); // NEW CONTEXT AGAIN
  Cliente cliente1= rep1.GetById(1);
  </code></pre>
  
  <p>Any idea how to solve it using Unity?</p>
  
  <p>Tks.  </p>