This question is locked. New answers and comments are not allowed.
I wonder if it's possible to setup a many-to-many relationship that both supports direct links between to major entities as well as query access to the mapping table?
My current association looks like this:
HasAssociation(x => x.Tags).WithOpposite(x => x.Pages).MapJoinTable("PageTag", (x, y) => new { x.PageId, y.TagId }).CreatePrimaryKeyFromForeignKeys();
..and mirrored in other mapping as:
HasAssociation(x => x.Pages).WithOpposite(x => x.Tags);
This works great, I can access Tag.Pages and Page.Tags. But I would also like to be able to query the join table directly without getting the major entities (in other words just the id's that it consists of). Is it possible to do that somehow and still keep the direct links? I tried to add a join-entity and map it to the table but since it's already defined above it throws an error.
Grateful for any help :)
My current association looks like this:
HasAssociation(x => x.Tags).WithOpposite(x => x.Pages).MapJoinTable("PageTag", (x, y) => new { x.PageId, y.TagId }).CreatePrimaryKeyFromForeignKeys();
..and mirrored in other mapping as:
HasAssociation(x => x.Pages).WithOpposite(x => x.Tags);
This works great, I can access Tag.Pages and Page.Tags. But I would also like to be able to query the join table directly without getting the major entities (in other words just the id's that it consists of). Is it possible to do that somehow and still keep the direct links? I tried to add a join-entity and map it to the table but since it's already defined above it throws an error.
Grateful for any help :)