Let’s say i have this:
public partial class AccessMask
{
public int AccessMaskID { get; set; }
=== bla bla bla ===
public virtual ICollection<Role> Role { get; set; }
}
public partial class Role
{
public int RoleID { get; set; }
=== bla bla bla==
public virtual ICollection<Forum> Forum { get; set; }
public virtual ICollection<Rank> Rank { get; set; }
public virtual ICollection<User> User { get; set; }
public virtual ICollection<AccessMask> AccessMask { get; set; }
}
And now a big question. How to make query between those two? As you may see it’s many-to-many relation. And What I want to do is to join this and get access mask connected with role.
bla bla bla- some random properties that are completly irrevelant.
UPDATE!
I know I can use:
Include()
But using it for lot’s of queries.. will be a bad idea. Because I have quite a few many-to-many relationships that look similiar.
Or Do I have to simply redeisgn my model, to something more traditional with joining entity ?
For retrieving data, it will work the same way as any other navigation property:
However, I have had a very rough time of getting many-to-many data to save.