1
我已经添加了一些属性,我的应用程序的用户类别,就像下面:如何更新/编辑asp.net标识中的用户个人资料信息EF代码第一种方法?
public class ApplicationUser : IdentityUser
{
public string Name { get; set; }
public string LastName { get; set; }
public DateTime? DOB { get; set; }
public string Gender { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
}
而且我在RegisterViewModel
相应增加这些属性,并相应地更新Register
视图。一切都运行超级好,我可以添加用户添加这些自定义属性。 问题是如何在用户创建帐户后更新/编辑用户配置文件数据,包括(姓名,姓氏,出生日期等)。 我知道我必须有一个ActionResult
方法,但坦率地说,我不太了解它。 Regards