title: How to inject my dbContext with Unity
body: <p>How do I inject my dbContext class using Unity? I can't just create a Interface like for my other "normal" classes? What should I do with my RequestContext class and what should my UnityConfig look like?</p>
  
  <pre><code>public class RequestContext : IdentityDbContext&lt;User&gt;
      {
          public RequestContext()
              : base("DefaultConnection", throwIfV1Schema: false)
          {
              Database.SetInitializer&lt;RequestContext&gt;(new CreateDatabaseIfNotExists&lt;RequestContext&gt;());
          }
  
          public DbSet&lt;Request&gt; Requests { get; set; }
          public DbSet&lt;Record&gt; Records { get; set; }
  
  
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
              base.OnModelCreating(modelBuilder);
          }
  
          public static RequestContext Create()
          {
              return new RequestContext();
          }
      }
  </code></pre>
  
  <p>In my Repository class i use it like this but want to inject instead:</p>
  
  <pre><code> private RequestContext dbContext;
   private IUserRepository _userRepository;
  
   public RequestRepository(IUserRepository userRepository)
   {
        dbContext = new RequestContext();
        _userRepository = userRepository;
   }
  </code></pre>