Is it possible to create a mapping from 2 tables and have them share a link table? I am not sure if this would work, but there may be a better way to do this and wanted to get some advice. Here is my idea for the mappings:
//For Attachments
HasOptional(a => a.Subscription).WithMany().Map(m => {m.MapLeftKey("SubscriptionID"); m.MapRightKey("EntityId"); m.ToTable("Subscriptions);});
//For Submittals
HasOptional(s => s.Subscription).WithMany().Map(m => {m.MapLeftKey("SubscriptionID"); m.MapRightKey("EntityId"); m.ToTable("Subscriptions);});
Will this create the one link table for both entities to share? Is this a good approach or should I have a FKs for each entity in a subscription table?
Update: I don’t think those mappings will work since it is a many-to-one? This may be more appropriate:
HasOptional(s => s.Subscription).WithMany().Map(m => {m.MapKey("EntityId"); m.ToTable("Subscriptions");});

Thinking about this some more, this is not how it works. I ended up just having the FKs for all types in the Subscriptions class. works just like I need.