title: Register partically closed generic type with Autofac
body: <p>I have <code>UnitofWork</code> class and it implement <code>IUnitOfWork</code>. I try to register that with Autofac:</p>
  
  <pre><code>var builder = new ContainerBuilder();
  builder
      .RegisterGeneric(typeof(UnitOfWork&lt;Repository&lt;&gt;,&gt;))
      .As(typeof(IUnitOfWork))
      .InstancePerDependency();
  </code></pre>
  
  <p>Implementation is:</p>
  
  <pre><code>public class UnitOfWork&lt;T, O&gt; : IUnitOfWork
      where T : Repository&lt;O&gt;
      where O : BaseEntity
  {
  }
  
  public interface IUnitOfWork : IDisposable
  {
      void SaveChanges();
  }
  </code></pre>
  
  <p>Gives an error <strong>"Type expected"</strong></p>
  
  <p>but this one work on another project:</p>
  
  <pre><code>public class Repository&lt;T&gt; : GenericRepository&lt;T&gt; 
      where T : BaseEntity
  {
      public Repository(IDbContext context) : base(context) { }   
  }
  
  public abstract class GenericRepository&lt;T&gt; 
      : IRepository&lt;T&gt;, IQueryable&lt;T&gt; where T : BaseEntity
  {
  }
  
  builder
      .RegisterGeneric(typeof(Repository&lt;&gt;))
      .As(typeof(IRepository&lt;&gt;))
      .InstancePerHttpRequest();
  </code></pre>