Is it possible to directly reference a many-to-many table using entity framework, code first
- 阅读更多 关于 Is it possible to directly reference a many-to-many table using entity framework, code first
问题 I am using the entity framework and modelling a many-to-many relationship. I have created the relationship between the two entities using the fluent API (let's say users and groups): this.HasMany(t => t.Users) .WithMany(t => t.Groups) .Map( m => { m.ToTable("GroupMembers"); m.MapLeftKey("Group_Id"); m.MapRightKey("User_Id"); }); This works great, but I'd like to also be able to reference the GroupMembers table directly. To do that, I have something like: [Table("GroupMembers")] public class