我有以下内容:
namespace BilBasen.Data.Migrations
{
public class TestMigration : DbMigration
{
public override void Up()
{
CreateTable("TestMigrationTable", t => new { Id = t.Int(identity: true, nullable: false), Name = t.String(nullable: true) });
}
public override void Down()
{
DropTable("TestMigrationTable");
}
}
public class MigrateExecuter
{
public void UpdateToLatest()
{
var conf = new DbMigrationsConfiguration<LocalInstans2Context>();
conf.AutomaticMigrationsEnabled = false;
conf.MigrationsNamespace = "BilBasen.Data.Migrations";
conf.MigrationsAssembly = typeof(LocalInstans2Context).Assembly;
var migrator = new DbMigrator(conf);
migrator.Update();
}
}
public class LocalInstans2Context : DbContext
{
}
}
迁移器未检测到迁移..
有什么建议么?