I am using ASPNet Identity to implement security in my web application.
There is a requirements where in, I need to extend the IdentityRole and IdentityUser.
Here is my code to extend the IdentityUser.
public class ApplicationUser : IdentityUser
{
public virtual User User { get; set; }
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("name=CoreContext")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<IdentityUser>()
.ToTable("AspNetUsers");
modelBuilder.Entity<ApplicationUser>()
.ToTable("AspNetUsers");
}
}
My only problem is the IdentityRole