I use ASP.NET Identity 2
in an MVC 5
project and I want to update Student
data by using UserManager.Update()
method. However,
This took me a little while to understand, but you simply need to use the UserManager. My task was to simply update the LoginViewModel with a new Date. I tried different methods, but the only thing that seemed to work was FindByEmailAsync, which is specific to my MODEL because I'm not using Id to sign in.
Case SignInStatus.Success
Dim user As ApplicationUser = Await UserManager.FindByEmailAsync(model.Email)
user.LastActivityDate = model.LastActivityDate
UserManager.Update(user)
Return RedirectToLocal(returnUrl)