I apologize if the title does not make sense. I will try my best to explain what I am trying to achieve.
I have these two entities that both have a collection of the same entity type.
I hoping to see if there is a way in the override of OnModelCreating to tell EFCore that Entity1 and Entity2 both use the Entity3 DB table to populate its collection.
When querying to populate Entity1's SubEntites collections it should do something like the following. The type column will be mapped to an enum.
// When populating Entity1
SELECT * FROM Entity3 WHERE ForeignID = [Entity1.ID] AND Type = 1;
// When populating Entity2
SELECT * FROM Entity3 WHERE ForeignID = [Entity1.ID] AND Type = 2;