Consider the following:
```
public class BaseUser
{
public int Id { get; set; }
public string Name { get; set; }
}
public class DerivedUser : BaseUser
{
public string Credentials { get; set; }
}
public class MyContext<TUser> : DbContext where TUser : BaseUser
{
public DbSet<TUser> Users { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<TUser>().ToTable("MyTable");
}
}
```
When trying to Enable-Migrations, we get this output:
```
internal sealed class Configuration : DbMigrationsConfiguration<ConsoleApplication1.MyContext`1>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
}
protected override void Seed(ConsoleApplication1.MyContext`1 context)
{
}
}
```
which is broken. We should either fix this or provide a guidance to a user upon executing Enable-Migrations (e.g. derive from the generic DbContext and enable migrations for that context)
```
public class BaseUser
{
public int Id { get; set; }
public string Name { get; set; }
}
public class DerivedUser : BaseUser
{
public string Credentials { get; set; }
}
public class MyContext<TUser> : DbContext where TUser : BaseUser
{
public DbSet<TUser> Users { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<TUser>().ToTable("MyTable");
}
}
```
When trying to Enable-Migrations, we get this output:
```
internal sealed class Configuration : DbMigrationsConfiguration<ConsoleApplication1.MyContext`1>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
}
protected override void Seed(ConsoleApplication1.MyContext`1 context)
{
}
}
```
which is broken. We should either fix this or provide a guidance to a user upon executing Enable-Migrations (e.g. derive from the generic DbContext and enable migrations for that context)