I, for the life of me, cannot get rid of this error message. I tried almost everything I can.
MyDBContext.cs
public MyDBContext() : base("ConnStr_Dev")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
Database.SetInitializer(new MigrateDatabaseToLatestVersion<MyDBContext, DbMigrationsConfiguration<MyDBContext>>());
base.OnModelCreating(modelBuilder);
}
GenericRepository.cs
public void Insert(T obj)
{
table.Add(obj);
}
Tried it all in different combinations.
Enable-Migrations -EnableAutomaticMigrations -Force
Add-migration Initial -IgnoreChanges
Update database
I tried to delete the Migrations table, deleting the entire database, that's all.
Any migration experts?
Edit: DAL contains a GenericRepository and a context class.
source
share