I am exploring the new asp.net identity. Adding fields to the Users table "AspNetUsers" using code-first and migration features seems great.
I want to add columns like "Name", "CreatedOn", and "CreatedFromIP" and be able to read it from .NET
Is there a simple solution?
You can simply open the database from App_Start folder and modify the fields. (In case your using the template)
public class ApplicationUser : IdentityUser
{
public string YourProperyHere { 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;
}
}
Read more here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With