我想使用 Identity.EntityFramework": "3.0.0-rc1-final" 在 VS 2015 中实现用户和角色管理器。
其中,我创建了一个 IdentityManager 类。
我的主要问题是创建一种方法来检查角色是否存在,如下所示。
public bool RoleExists(string name)
{
var RoleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new ApplicationDbContext()));
return RoleManager.RoleExists(name);
}
我不断收到错误消息new RoleManager<IdentityRole>
:
没有给出对应于 roleValidators、keyNormalizer、errors、logger、contextAccessor 的参数"
是的,基本上我没有指定所有参数,但我不知道如何处理这些。
我对此很陌生,并且已经搜索和尝试了几天,如果有人能指出我正确的方向,我愿意做腿部工作和测试,我只需要一些文档。