I switched to using the new ASP.NET Identity 2. I really use Microsoft ASP.NET Identity Samples 2.0.0-beta2.
Can someone tell me where and how I can change the code so that it saves the username and last user along with the user data. Will this be part of the claim now, and if so, how can I add it?
I assume that I will need to add this here, which is the register method in the account controller:
if (ModelState.IsValid) { var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { var code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>"); ViewBag.Link = callbackUrl; return View("DisplayEmail"); } AddErrors(result); }
Also, if I really added the first and last name, then where is it stored in the database? Do I need to create an extra column in a table for this information?
c # asp.net-identity asp.net-identity-2
Melina
source share