EF code first - Model compatibility cannot be checked because the database does not contain model metadata

前端 未结 5 875
一向
一向 2020-12-29 16:16

I have enabled automatic migrations. Then, I deleted my whole db. Next, i executed Update-database from command console, and it recreated my db. Then, I started

5条回答
  •  别那么骄傲
    2020-12-29 16:30

    Add this to your context:

    protected override void OnModelCreating(ModelBuilder modelBuilder) 
    {
        modelBuilder.Conventions.Remove();
    }
    

提交回复
热议问题