简体   繁体   English

Asp.Net mvc5 Identity版本1.0.0中的忘记密码

[英]Forgot Password in Asp.Net mvc5 Identity version 1.0.0

I have been trying to implement 'Forgot Password' functionality in my mvc5 web application. 我一直在尝试在我的mvc5 Web应用程序中实现“忘记密码”功能。 There are new updates in Identity.EntityFramework 2.2.1 package, but its difficult to migrate to the new version. Identity.EntityFramework 2.2.1程序包中有新的更新,但是很难迁移到新版本。 So i have to do the work implicitly. 所以我必须隐式地做这项工作。

I am following this tutorial Forgot Password in MVC5 我正在按照本教程在MVC5中忘记密码

Can't figure out what the author is trying to do in ResetPassword ActionMethod.. Got Error in this line: AspNetUser user = _repoAspDotNetUser.GetAspNetUser(email); 无法找出作者在ResetPassword ActionMethod中尝试执行的操作。在此行出现错误: AspNetUser user = _repoAspDotNetUser.GetAspNetUser(email); Help would be highly Appreciated.. 帮助将不胜感激..

Given your answers in the comments on your question, you should be able to replace the line causing an error with something like the following: 给定您对问题的评论中的答案,您应该可以使用以下内容替换导致错误的行:

ApplicationUser user = _userManager.FindByEmail(email);

You can use var instead of ApplicationUser if you prefer. 如果愿意,可以使用var代替ApplicationUser I've made an assumption that your instance of UserManager is called _userManager , but I'm sure you can figure it out from there. 我已经假设您的UserManager实例称为_userManager ,但是我敢肯定您可以从那里弄清楚。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM