I have the following legacy table structure (simplified for this post)
The following is my feeble attempt at configuring the Entity:
public class EntityConfiguration : EntityTypeConfiguration<Entity> {
public EntityConfiguration() {
ToTable("Entity");
HasKey(x => x.Id);
Property(x => x.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
HasMany(x => x.TypeOneUpdateBlacklist)
.WithMany()
.Map(x => {
x.ToTable("UpdateBlacklist");
x.MapLeftKey("EntityId");
x.MapRightKey("UpdateId");
});
HasMany(x => x.TypeTwoUpdateBlacklist)
.WithMany()
.Map(x => {
x.ToTable("UpdateBlacklist");
x.MapLeftKey("EntityId");
x.MapRightKey("UpdateId");
});
}
The configuration renders this error:
The EntitySet 'EntityBlacklistUpdate' with schema 'dbo' and table 'UpdateBlacklist' was already defined. Each EntitySet must refer to a unique schema and table.
Is there away to configure this? Thanks in advance