当Context从IdentityDbContext继承时,OnModelCreating失败

Abi*_*i P 2 ef-code-first asp.net-identity-2

我的数据访问实现如下,并且正在运行

  1. Contexct继承自DB Context
  2. 有OnModelCreating配置
  3. 手动添加配置

但是我修改了我的背景下inherit,从IdentityDbContext<ApplicationUser>和停止手动生成的配置,之后的OnModelCreating失败,数据库更新不会发生的.

如果我删除它OnModelCreating,它工作正常.我一运行应用程序.

任何人都可以指导我这里出错吗?

Abi*_*i P 5

我错过了OnModelCreating方法覆盖中的以下行.之后它开始工作了.

base.OnModelCreating(modelBuilder); 
Run Code Online (Sandbox Code Playgroud)