无法为“ IdentityRole”创建DbSet,因为此类型不包含在上下文错误的模型中

时间:2018-07-27 01:44:33

标签: postgresql

你好,我想为我的aspnetcore2.0 + postgresql项目添加基于角色的身份验证。因此,我跟随 How to create roles in asp.net core and assign them to users

但是我得到了错误

无法为“ IdentityRole”创建DbSet,因为此类型不包含在上下文模型中

顺便说一句,我的数据库表中没有identityrole和identityuser表。

可以从http://eticaret.turkalpkucur.com/katmanliproje2.rar

下载简单的项目

1 个答案:

答案 0 :(得分:0)

如果您的上下文称为DBContext,则可能是名称空间错误。