1
I’m trying to customize the Identity Claims table, through the Identityuserclaim class.
I am using a mapping, through the Entitytypeconfiguration class, but I get the error:
A Configuration for type 'Microsoft.AspNet.Identity.EntityFramework.Identityuserclaim' has already been Added. To Reference the existing Configuration use the Entity() or Complextype() methods.
The Dbcontext Onmodelcreating method 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 class Applicationuserclaimconfiguration maps the class Applicationuserclaim : Identityuserclaim to the same table Userclaim.
Does anyone know how to solve this problem?
Thank you.
It seems that you are creating twice the same table tests only with a Configuration only
– Eduardo Sampaio