I\'m using asp.net Identity 2.0 for users to log into my website, where the authentication details are stored in an SQL database. Asp.net Identity has been implemented in a
If have already created the project with 'Authentication Individual User Accounts:
In Solution Explorer go to project>Models>IdentityModels.cs
under public class ApplicationUser: IdentityUser (should be the first class).
Add your custom properties after
public async Task like my example below:
public class ApplicationUser : IdentityUser
{
public async Task GenerateUserIdentityAsync(UserManager 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;
}
**//add custom properties here - these are just examples**
public bool SendEmails { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
Then using NuGet Packagemanager:
I hope this helps..