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
You should be able to create the many-to-many mapping with the base type
Update:However, it would require that your class
Entitydoes only have a navigation collectionUpdatesof the base type instead of two navigation collections for the two derived types. And it is only possible if the database schema really represents an inheritance model, i.e. a givenUpdaterow can either have a relatedTypeOneUpdateor aTypeTwoUpdaterow, both never both. If it can have both, you cannot map this with TPT but you would have to create one-to-one relationships.