Database.SetInitializer to null not working Entity Framework 4.3.1 Code First

前端 未结 2 1735
暗喜
暗喜 2020-12-10 20:03

I have a context class that inherits from an abstract base AuditableDbContext : DbContext. The AuditableDbContext takes two parameters, one for the

2条回答
  •  不思量自难忘°
    2020-12-10 20:18

    You will need to do this in the static constructor or better still PRIOR to instantiating the Context.

    static MyDbContext() {
        Database.SetInitializer(null);
    }
    

提交回复
热议问题