I'm trying to customize the Identity Claims table, through the IdentityUserClaim class.
I'm using a mapping, through the EntityTypeConfiguration class, but I get the error:
The configuration for type 'Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim' has already been added. To reference the existing configuration use the Entity () or ComplexType () methods.The OnModelCreating method of DbContext, looks like this:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Configurations.Add(new ApplicationUserClaimConfiguration());
modelBuilder.Configurations.Add(new ApplicationIdentityUserClaimConfiguration());
modelBuilder.Configurations.Add(new ApplicationIdentityRoleConfiguration());
modelBuilder.Configurations.Add(new ApplicationRoleConfiguration());
modelBuilder.Configurations.Add(new ApplicationUserConfiguration());
}
The ApplicationIdentityUserClaimConfiguration class looks like this:
public class ApplicationIdentityUserClaimConfiguration : EntityTypeConfiguration<IdentityUserClaim>
{
public ApplicationIdentityUserClaimConfiguration()
{
ToTable("UserClaim");
}
}
The ApplicationUserClaimConfiguration class maps the ApplicationUserClaim: IdentityUserClaim class to the same UserClaim table.
Does anyone know how to solve this problem?
Thank you.