[英]How do I do a many-to-many relationship in LINQ?
I have two tables say, t1 and t2 that have t1.t1_id and t2.t2_id as primary keys. 我有两个表,即t1和t2,它们具有t1.t1_id和t2.t2_id作为主键。 They are related by table t3 with columns t3.t1_id and t3.t2_id, respectively.
它们在表t3中分别与列t3.t1_id和t3.t2_id相关联。 Using LINQ I get an EntitySet<t3> on class t1 and t2, but what I want is an EntitySet<t2> on class t1 and EntitySet<t1> on class t2.
使用LINQ,我在类t1和t2上获得了EntitySet <t3>,但是我想要的是在类t1上的EntitySet <t2>和在类t2上的EntitySet <t1>。 How do I do this?
我该怎么做呢?
Try this: 尝试这个:
From Mitsu's Blog on MSDN 从MSDN上的Mitsu博客
Update: I forgot to link part 2 of the blog entry: Second Part 更新:我忘了链接博客条目的第2部分 : 第二部分
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.