我知道这个帖子已经发了很久了,问题的上下文大概是针对mvc2或更早的。
现在是 mvc3,我想也许其他寻求 mvc5 上下文答案的人可能会对这个解决方案感兴趣。
在启用了个人用户帐户的标准 mvc5 项目中,您将在 {Project}/Models/IdentityModel.cs 中找到可供使用的以下代码块
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
}
只需向这个类添加更多属性,这些属性就会被持久化到数据库中。
public class ApplicationUser : IdentityUser
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public bool Active { get; set; }
public DateTime DateRegistered { get; set; }
}