ASP.NET中,如何解决AddToRole和IdentityRole不属于当前上下文模型的问题?

2026-03-30 12:220阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计785个文字,预计阅读时间需要4分钟。

ASP.NET中,如何解决AddToRole和IdentityRole不属于当前上下文模型的问题?

我在使用Identity 2.1处理asp.net应用程序的用户角色时,暂时遇到了问题。我创建了一个从IdentityDBContext扩展的新上下文,并扩展了IdentityUser和IdentityRole以添加几个新字段。但是,当我尝试使用U字段时,遇到了困难。

阅读全文

本文共计785个文字,预计阅读时间需要4分钟。

ASP.NET中,如何解决AddToRole和IdentityRole不属于当前上下文模型的问题?

我在使用Identity 2.1处理asp.net应用程序的用户角色时,暂时遇到了问题。我创建了一个从IdentityDBContext扩展的新上下文,并扩展了IdentityUser和IdentityRole以添加几个新字段。但是,当我尝试使用U字段时,遇到了困难。

阅读全文