title: EF Code First Migration: How to inherit MigrateDatabaseToLatestVersion
body: <p>I want to derive a class from MigrateDatabaseToLatestVersion in my project. </p>
  
  <pre><code>public abstract class BaseDatabaseInitializer&lt;TContext&gt; : MigrateDatabaseToLatestVersion&lt;TContext, MigrationConfiguration&gt;
      where TContext : DbContext
  </code></pre>
  
  <p>MigrationConfiguration class looks like this</p>
  
  <pre><code>internal sealed class MigrationConfiguration : DbMigrationsConfiguration&lt;QAdminDbContext&gt;
  {
      public MigrationConfiguration()
      {
          AutomaticMigrationsEnabled = true;
      }
  
      protected override void Seed(QAdminDbContext context)
      {
          //  This method will be called after migrating to the latest version.
  
          //  You can use the DbSet&lt;T&gt;.AddOrUpdate() helper extension method 
          //  to avoid creating duplicate seed data. E.g.
          //
          //    context.People.AddOrUpdate(
          //      p =&gt; p.FullName,
          //      new Person { FullName = "Andrew Peters" },
          //      new Person { FullName = "Brice Lambson" },
          //      new Person { FullName = "Rowan Miller" }
          //    );
          //
      }
  }
  </code></pre>
  
  <p>But I am not allowed to do so and am getting an error </p>
  
  <pre><code>"Inconsistent accessibility: base class 'System.Data.Entity.MigrateDatabaseToLatestVersion&lt;TContext,Lutron.Application.QAdmin.Database.EntityConfiguration.MigrationConfiguration&gt;' is less accessible than class 'Lutron.Application.QAdmin.Database.BaseDatabaseInitializer&lt;TContext&gt;'    E:\Proj\Lutron\Code\src\Lutron\Gulliver\QAdmin\DataAccess\Database\BaseDatabaseInitializer.cs   17  27  Database"
  </code></pre>
  
  <p>This is due to the fact that MigrateDatabaseToLatestVerion class has explicitly defined where clause for MigrationConfigurationContext.</p>
  
  <p>Since, in my custom class, I have explicitly defined '<code>Configuration</code>' class, I can't add where clause.</p>