When we have two many-to-many related entities and create the navigation properties correctly, the entity creates an extra table to set up this relationship.
In the case where I'm working I have a structure that in the best of worlds would look like this:
public class User {
public string Name {get;set}
public int id
}
public class Forum {
public string Title {get;set}
public virtual ICollection<User> Participants {get;set}
public virtual ICollection<User> Followers {get;set}
}
The problem here is precisely because it has two properties of type User. The entity will try to save everything in the same table, and will create two foreign keys in User.
What is good practice in this case? Would you create two different entities (Participants and Followers) and store the User and Forum ids in each of them?