“Context cannot be used while the model is being created” exception with ASP.NET Identity

后端 未结 7 1270
遥遥无期
遥遥无期 2020-12-01 07:42

Why is this happening when we make a call to the AccountApiController.Register() method?

  • what is trying to use the context?
  • what is trying to create
7条回答
  •  眼角桃花
    2020-12-01 08:01

    I'm using EF Code First in a multi-layered architecture with MySQL and had the same exception and using the following line inside the DBContext Class constructure works:

    Database.SetInitializer(null);
    

提交回复
热议问题