简体   繁体   English

如何使用用户管理器<identityuser>与用户存储<identityuser> ?</identityuser></identityuser>

[英]How to use UserManager<IdentityUser> with UserStore<IdentityUser>?

this is a snippet of my ASP.Net MVC Core project.这是我的 ASP.Net MVC Core 项目的一个片段。

UserStore<IdentityUser> userStore = new UserStore<IdentityUser>(_db);
UserManager<IdentityUser> userManager = new UserManager<IdentityUser>(userStore);

I am receiving the error message below from UserManager's parameter input.我从 UserManager 的参数输入中收到以下错误消息。

在此处输入图像描述

I've tried changing userStore's data type to IUserStore and var, but they result in the same errors.我尝试将 userStore 的数据类型更改为 IUserStore 和 var,但它们会导致相同的错误。 Please help!请帮忙!

Try:尝试:

 UserManager<IdentityUser> userManager = new UserManager<IdentityUser>(userStore,null, null, null, null, null, null, null, null);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何模拟UserManager <IdentityUser> - How to mock UserManager<IdentityUser> 如何使用 UserManager 在 IdentityUser 上加载导航属性 - How to load navigation properties on an IdentityUser with UserManager 如何在UserManager和UserStore中使用DI - How to use DI with UserManager and UserStore UserManager是否 <IdentityUser> 有缓存吗? - Does UserManager<IdentityUser> have cache? 如何向IdentityUser添加额外信息并扩展UserManager方法 - How to add extra information to IdentityUser and extend UserManager methods 如何将IdentityUser设置为ForeignKey? - How to set IdentityUser as a ForeignKey? 如何将IdentityUser转换为BaseEntity - How to convert IdentityUser to BaseEntity ASP.net身份:如何获取当前的IdentityUser(ApplicationUser)? UserManager.FindById在哪里? - ASP.net identity: How to get current IdentityUser (ApplicationUser)? Where is UserManager.FindById? 不相关机型之间如何使用linq join? (其中之一是 IdentityUser) - How to use linq join between unrelated models? (one of them is IdentityUser) 管理员声明已添加到IdentityUser中,但usermanager不能通过IsInRoleAsync找到它 - Admin claim added to IdentityUser, but the usermanager does not find it with IsInRoleAsync
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM