首页 > 解决方案 > Asp.net Identity:无法从 CustomUserRole 转换为 IdentityUserRole

问题描述

新手,我遇到了以下错误,我不知道如何解决这个问题。我确实将 Identity 中用户的主键更改为 int,而不是将其存储为字符串。(我相信这是导致问题的原因)。除此之外,所有其他页面都运行良好。关于从哪里开始的任何想法?

CS1503 参数 1:无法从 'System.Collections.Generic.ICollection<DraftIntellectualProperty.Models.CustomUserRole>' 转换为 'System.Collections.Generic.ICollection<Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole>'

错误:管理.aspx

在代码隐藏中调用的方法:管理.aspx.cs

从 IdentityModel 截取:身份模型.cs

从 IdentityUserRole 类中截取:身份用户角色

标签: c#asp.net-identity

解决方案


推荐阅读