gpt4 book ai didi

postgresql - 无法为 'IdentityRole' 创建 DbSet,因为此类型未包含在上下文错误的模型中

转载 作者:行者123 更新时间:2023-11-29 13:43:49 26 4
gpt4 key购买 nike

您好,我想为我的 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下载

最佳答案

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

关于postgresql - 无法为 'IdentityRole' 创建 DbSet,因为此类型未包含在上下文错误的模型中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51549681/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com