c# - 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>'
错误:
在代码隐藏中调用的方法:
从 IdentityModel 截取:
从 IdentityUserRole 类中截取:
解决方案
推荐阅读
- css - 让独立的孩子在没有明确身高的情况下拥有父母的 100% 身高
- jenkins - 如何在测试工具中模拟 Jenkins 作业参数?
- c# - 索引超出 C# 控制台应用程序中数组错误的范围
- c# - 存储过程返回可为空的 DateTime 而不是 varchar
- python-3.x - python中的doopl参数设置
- sql - 在 SQL 中,有没有办法拆分 SQL 中存储为列表的列?
- ruby-on-rails - 在 ruby on rails 中自定义 JSON 响应
- sql - 从 Presto SQL 中的字符串获取日期
- regex - 在 grep/pgrep 过滤器中不使用 -v 不是“x”或“y”?
- ansible - 如何使用 Ansible 从另一个列表中删除子列表