You'll need to add it to your ApplicationUser
class so if you use Identity Samples, I imagine you have something like that in your IdentityModels.cs
public class ApplicationUser : IdentityUser {
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;
}
}
after adding First and Last Names it would look like this:
public class ApplicationUser : IdentityUser {
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;
}
public string FirstName { get; set; }
public string LastName { get; set; }
}
Then when you register user, you need to add them to the list now that they are defined in ApplicationUser
class
var user = new ApplicationUser { UserName = model.Email, Email = model.Email, FirstName = "Jack", LastName = "Daniels" };
first and last names will end up in AspNetUsers
table after you do the migrations