<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx</link><description>In this article, I will show one possible solution to implement many-to-many relationship using Linq to Sql. Let's begin with some definitions and what Linq to Sql offers. A “many to many” relationship between two entities defines a kind of bi-directional</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Quick LINQ link list</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#3694198</link><pubDate>Thu, 05 Jul 2007 00:39:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3694198</guid><dc:creator>Linq in Action News</dc:creator><description>&lt;p&gt;Some quick links about LINQ: Articles about extension methods by the Visual Basic team Third-party LINQ&lt;/p&gt;
</description></item><item><title>Quick LINQ link list</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#3694199</link><pubDate>Thu, 05 Jul 2007 00:39:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3694199</guid><dc:creator>Fabrice's weblog</dc:creator><description>&lt;p&gt;Some quick links about LINQ: Articles about extension methods by the Visual Basic team Third-party LINQ&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#3999219</link><pubDate>Sun, 22 Jul 2007 17:36:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3999219</guid><dc:creator>Roger Jennings</dc:creator><description>&lt;p&gt;Pingback from &lt;a rel="nofollow" target="_new" href="http://oakleafblog.blogspot.com/2007/07/linq-update-for-week-of-july-16-2007.html"&gt;http://oakleafblog.blogspot.com/2007/07/linq-update-for-week-of-july-16-2007.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Community Convergence XXIX</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#4374530</link><pubDate>Tue, 14 Aug 2007 03:44:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4374530</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;There are several good new blogs from members of the Microsoft C# team. Nevertheless, the most important&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#4509036</link><pubDate>Wed, 22 Aug 2007 14:38:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4509036</guid><dc:creator>Neal Chamen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have downloaded the code from your article as I thought it looked a perfect solution for something I needed to do.&lt;/p&gt;
&lt;p&gt;Unfortunately, although my code builds and the intellisense works, I get an error when attempting a foreach iteration: &amp;quot;Binding Error: Member 'Section.Questions' is not a mapped member of 'Section' (in my code, Section and Question are the equivalent of Order and Product in yours).&lt;/p&gt;
&lt;p&gt;I also have the problem that after referencing Section.Questions in code, I often find Visual Studio crashes! I have had to write code in Notepad and paste it in. I am using Visual Studio 2008 Beta 2.&lt;/p&gt;
&lt;p&gt;Any thoughts much appreciated.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#4532780</link><pubDate>Fri, 24 Aug 2007 02:09:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4532780</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Hi Neal,&lt;/p&gt;
&lt;p&gt;What UI technology are you using ? (web, winforms, wpf). Could you send me Section and Question classes by email ? (including partial definition adding .Questions property)&lt;/p&gt;
&lt;p&gt;Mitsu&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#4840949</link><pubDate>Sun, 09 Sep 2007 10:41:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4840949</guid><dc:creator>Dav Evans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm having the same issue as Neal. When ever I reference a collection of type listSelector Visual Studio 2008 Beta crashes. It happens when I try and get intellisence from the collection to get a property such as 'count' or a methos like 'Add' from the collection. Pasting in from notepad only sometimes works for me. Im using ASP.NET on Windows Vista. The ListSelector property is sitting in a partial class.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#4858361</link><pubDate>Tue, 11 Sep 2007 04:03:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4858361</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Hi Dav,&lt;/p&gt;
&lt;p&gt;Could you send me a sample at mitsufu@microsoft.com ?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mitsu&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#5996731</link><pubDate>Fri, 09 Nov 2007 00:52:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5996731</guid><dc:creator>Joel Ephroni</dc:creator><description>&lt;p&gt;Mitsu,&lt;/p&gt;
&lt;p&gt;I am trying to use your excellent code but I am using 2008 beta2 and apparently, it is very broken in beta2. Do perhapshave a version that will work with beta2 that you can share with us? :) Thank you for sharing your knowledge! :)&lt;/p&gt;
&lt;p&gt;Joel&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#6007408</link><pubDate>Fri, 09 Nov 2007 09:43:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6007408</guid><dc:creator>Joel Ephroni</dc:creator><description>&lt;p&gt;Specifically, when I try to run the sample code, I get Error&lt;/p&gt;
&lt;p&gt;&amp;quot;The type or namespace name 'TableAttribute' does not exist in the namespace 'System.Data.Linq' (are you missing an assembly reference?)	C:\...\ListSelector\ListSelector\Northwind.designer.cs	715	31	ListSelector&lt;/p&gt;
&lt;p&gt;Do you have a thought about why this might be happening?&lt;/p&gt;
&lt;p&gt;Joel&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#6012833</link><pubDate>Fri, 09 Nov 2007 13:27:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6012833</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think some things have changed in VS2008 latest builds (RC). TableAttribute is now available in System.Data.Linq.Mapping namespace.&lt;/p&gt;
&lt;p&gt;The simplest way is to recreate the dbml file, dropping the same tables.&lt;/p&gt;
&lt;p&gt;I will provide an updated source when VS gets RTM.&lt;/p&gt;
&lt;p&gt;A few weeks to wait...&lt;/p&gt;
&lt;p&gt;Mitsu&lt;/p&gt;
</description></item><item><title>.NET 3.5 released .. any news?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#6634748</link><pubDate>Sat, 01 Dec 2007 23:52:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6634748</guid><dc:creator>Anders Borum</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I bet you've got a copy of VS 2008 RTM along with .NET 3.5. Any chance you've aligned the code in this blog entry with the final release yet?&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
</description></item><item><title>Source updated for VS2008 RTM: how to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#6643862</link><pubDate>Mon, 03 Dec 2007 02:58:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6643862</guid><dc:creator>Mitsu's blog</dc:creator><description>&lt;p&gt;Just a short post to tell that I have replaced the source code with the VS2008 RTM version : &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx"&gt;http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Source updated for VS2008 RTM: how to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#6643880</link><pubDate>Mon, 03 Dec 2007 03:15:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6643880</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;Just a short post to tell that I have replaced the source code with the VS2008 RTM version : &lt;a rel="nofollow" target="_new" href="http://blogs"&gt;http://blogs&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Answers to frequently asked ASP.NET Dynamic Data questions</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#6798598</link><pubDate>Tue, 18 Dec 2007 21:51:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6798598</guid><dc:creator>David Ebbo's ASP.NET blog</dc:creator><description>&lt;p&gt;Now that ScottGu blogged about it , we have received a number of great feedback and questions.&amp;amp;#160;&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#7199505</link><pubDate>Tue, 22 Jan 2008 19:36:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7199505</guid><dc:creator>Tim S</dc:creator><description>&lt;p&gt;Thanks for this. It worked like a charm, and has made my life not-insignificantly easier.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#7674483</link><pubDate>Wed, 13 Feb 2008 16:56:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7674483</guid><dc:creator>Mihai Fagadar</dc:creator><description>&lt;p&gt;Hi Mitsu,&lt;/p&gt;
&lt;p&gt;Thanks for the post, it has been very useful. &lt;/p&gt;
&lt;p&gt;I have one question: If you remove a Product from an Order, how can you ensure that the corresponding Order_Detail is also removed ?&lt;/p&gt;
&lt;p&gt;Thanks !&lt;/p&gt;
&lt;p&gt;Mihai&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#7857749</link><pubDate>Sat, 23 Feb 2008 17:32:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7857749</guid><dc:creator>Chris Rock</dc:creator><description>&lt;p&gt;Added this to a list of LINQ TO SQL Tutorials, Articles and Opinions&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#7858159</link><pubDate>Sat, 23 Feb 2008 18:10:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7858159</guid><dc:creator>El Guapo</dc:creator><description>&lt;p&gt;Yes I am also interested in how to extend this for functionality to add or remove items from the relationship. It is very nice for read-only collection, but that's quite limited. Thanks.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8114169</link><pubDate>Sat, 08 Mar 2008 21:20:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8114169</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;I am working on a solution for adding add/remove support. I hope to publish it quickly.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8118466</link><pubDate>Sun, 09 Mar 2008 21:49:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8118466</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Your excellent extension is not terribly useful in a real application without the corresponding support for add/remove. &amp;nbsp;I can imagine a couple of ways to attack this, but I'm sure your solution will be more optimal.&lt;/p&gt;
&lt;p&gt;Any idea on when you might publish that?&lt;/p&gt;
&lt;p&gt;Thanks. &amp;nbsp;This is a critically important bridge until the EF gets here.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8166982</link><pubDate>Wed, 12 Mar 2008 10:24:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8166982</guid><dc:creator>Assaf Stone</dc:creator><description>&lt;p&gt;The ListSelector is a great idea. It is the best M:M solution I found so far.&lt;/p&gt;
&lt;p&gt;However, its inability to handle inserts and deletes is a big problem for me.&lt;/p&gt;
&lt;p&gt;Have you found any way to solve this yet?&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8205577</link><pubDate>Fri, 14 Mar 2008 19:05:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8205577</guid><dc:creator>John</dc:creator><description>&lt;p&gt;I have a poor man's insert that seems to work, although I haven't used it too much other than some basic testing. &amp;nbsp;(I tried several options to delete, and couldn't get anything to work - always get null key errors, even working from both directions in coordination).&lt;/p&gt;
&lt;p&gt;Below is a basic insert that seems to work. &amp;nbsp;Just call the method on the &amp;quot;parent&amp;quot; or containing class, passing in the contained object, and then call update on the context. &amp;nbsp;(See the Add...() method below)&lt;/p&gt;
&lt;p&gt;public partial class Case&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;// ....&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// Many-to-Many wrapping&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// Many thanks to Mitsu of MS, see his blog for List Selector (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/mitsu/"&gt;http://blogs.msdn.com/mitsu/&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;private ListSelector&amp;lt;CaseEvidence, Evidence&amp;gt; evidence = null;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; public ListSelector&amp;lt;CaseEvidence, Evidence&amp;gt; Evidence&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (evidence == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;evidence = this.CaseEvidences.AsListSelector(ce =&amp;gt; ce.Evidence);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return evidence;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void AddEvidence(Evidence e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CaseEvidence ce = new CaseEvidence();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ce.Evidence = e;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ce.Case = this;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.CaseEvidences.Add(ce);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// .....&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8327497</link><pubDate>Thu, 20 Mar 2008 19:19:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8327497</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Ok,&lt;/p&gt;
&lt;p&gt;Here is a possible solution for add/remove support:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/mitsu/archive/2008/03/19/how-to-implement-a-many-to-many-relationship-using-linq-to-sql-part-ii-add-remove-support.aspx"&gt;http://blogs.msdn.com/mitsu/archive/2008/03/19/how-to-implement-a-many-to-many-relationship-using-linq-to-sql-part-ii-add-remove-support.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think it's extensible enough to answer to many scenarios.&lt;/p&gt;
</description></item><item><title>LINQ-To-SQL N:M Beziehungen</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8407668</link><pubDate>Fri, 18 Apr 2008 14:50:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8407668</guid><dc:creator>msdn Austria</dc:creator><description>&lt;p&gt;n:m Beziehungen kommen in den meisten gro&amp;#223;en Datenbanken vor. Doch wie kann diese Beziehung mit LINQ-To-SQL&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8414860</link><pubDate>Mon, 21 Apr 2008 18:52:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8414860</guid><dc:creator>Athman</dc:creator><description>&lt;p&gt;just want to ask&lt;/p&gt;
&lt;p&gt;why if we make a relation database we cant add to the table&lt;/p&gt;
&lt;p&gt;as we see here in the picture we saw the 3 tables is fixed which mean no more rows can be added&lt;/p&gt;
&lt;p&gt;how it can be fix&lt;/p&gt;
</description></item><item><title>Implement a many-to-many relationship in LINQ to SQL</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8428255</link><pubDate>Sat, 26 Apr 2008 21:06:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8428255</guid><dc:creator>Hot Topics</dc:creator><description>&lt;p&gt;Mitsu Furata explores many-to-many relationships in LINQ to SQL in these two posts: How to implement&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8435865</link><pubDate>Mon, 28 Apr 2008 21:22:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8435865</guid><dc:creator>Fernando Arámburu</dc:creator><description>&lt;p&gt;Sorry but I&amp;#180;m misunderstanding something or the Order / Order Detail and Product is not a many to many relationship at all? There are two one to many relations &amp;nbsp;but no many to many...&lt;/p&gt;
&lt;p&gt;A good example would be one where the object in the middle of both many sides should not be modeled in object oriented programming. A good one... maybe a jobPost and a tag where one job are related with a collection of tags and also a tag is related with the collection of jobs that contains that tag.&lt;/p&gt;
</description></item><item><title>How to implement a many-to-many relationship using Linq to Sql ? Part II : add/remove support (转)</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8487763</link><pubDate>Sun, 11 May 2008 19:15:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8487763</guid><dc:creator>江南白衣</dc:creator><description>&lt;p&gt;In my previous post (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx"&gt;http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx&lt;/a&gt;), I had proposed a simple solution for implementing many-to-many relationships using Linq to Sql.&lt;/p&gt;
</description></item><item><title>Mitsu's blog : How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8519793</link><pubDate>Tue, 20 May 2008 01:10:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8519793</guid><dc:creator>247Blogging</dc:creator><description>&lt;p&gt;In this article, I will show one possible solution to implement many-to-many relationship using Linq to Sql. Let's begin with some definitions and what Linq to Sql offers. A “many to many” relationship between two entities defines a kind of bi-directiona&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8527078</link><pubDate>Wed, 21 May 2008 11:28:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8527078</guid><dc:creator>Dennie</dc:creator><description>&lt;p&gt;Thanks for this. This helped me a lot.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#8537776</link><pubDate>Fri, 23 May 2008 11:19:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8537776</guid><dc:creator>Arved Sandstrom</dc:creator><description>&lt;p&gt;Very nice stuff, much obliged. A few hours of tinkering to adapt to my database schema, and my second DataGridView started showing data pulled using your mechanism. Once I've got that foot in the door I'm happy.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9069071</link><pubDate>Fri, 14 Nov 2008 13:15:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9069071</guid><dc:creator>Srikanth</dc:creator><description>&lt;p&gt;Thanks for this. This helped me a lot.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9080802</link><pubDate>Sat, 15 Nov 2008 02:11:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9080802</guid><dc:creator>BACON</dc:creator><description>&lt;p&gt;I'm not understanding what exactly the ListSelector class offers that couldn't be accomplished by implementing the Order class as follows:&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;public partial class Order&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;		private IList&amp;lt;Product&amp;gt; products = null;&lt;/p&gt;
&lt;p&gt;		public IList&amp;lt;Product&amp;gt; Products&lt;/p&gt;
&lt;p&gt;		{&lt;/p&gt;
&lt;p&gt;			get&lt;/p&gt;
&lt;p&gt;			{&lt;/p&gt;
&lt;p&gt;				if (products == null)&lt;/p&gt;
&lt;p&gt;					products = Order_Details.Select(detail =&amp;gt; detail.Product).ToList().AsReadOnly();&lt;/p&gt;
&lt;p&gt;				return products;&lt;/p&gt;
&lt;p&gt;			}&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	}&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;That would address the &amp;quot;we are losing the direct access to the elements that we had with OrderDetails[i] and many other features (add/remove, notifications, etc)&amp;quot; issue, wouldn't it?&lt;/p&gt;
&lt;p&gt;Is it that, unlike returning a List&amp;lt;&amp;gt; object, a ListSelector offers delayed loading/deferred execution? &amp;nbsp;Although, I suppose even then the difference isn't that great because my implementation at least uses lazy initialization; it's not like the contents of the Products property will be retrieved when the Order is instantiated/loaded.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9097815</link><pubDate>Sat, 15 Nov 2008 16:45:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9097815</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;@BACON:&lt;/p&gt;
&lt;p&gt;Visually you will get the same but it's unusable.&lt;/p&gt;
&lt;p&gt;You will create a new collection at each time you will access the property !!!&lt;/p&gt;
&lt;p&gt;call order.Products[0] then order.Product[1] and you will get two products belonging to two different collections...&lt;/p&gt;
&lt;p&gt;The goal of the ListSelector class is to create a proxy over a unique collection, changing the item accessor. This allows not to recreate any extra collection while changing the element type of the resulting list.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9641225</link><pubDate>Tue, 26 May 2009 12:05:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9641225</guid><dc:creator>Anders Madsen</dc:creator><description>&lt;p&gt;I tried to use this pattern, but it makes Linq generate highly unusual SQL. The problem boils down to this:&lt;/p&gt;
&lt;p&gt;var order = db.Orders.First();&lt;/p&gt;
&lt;p&gt;foreach (var product in order.Order_Details.Select(x =&amp;gt; x.Product)) {&lt;/p&gt;
&lt;p&gt;//...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I would expect this to generate two SQL statements, one to find the order, and the an inner join between Order_Details and Product. However, when done like the above Linq to SQL generates one statement to find the order, on to find all entries in Order_Details, and then one statement FOR EACH matching row in Products.&lt;/p&gt;
&lt;p&gt;I am unable to understand why this is happening, but I can clearly see it if I output the generated queries by using the datacontext's Log property and the debug console.&lt;/p&gt;
&lt;p&gt;Strangely enough, if I do it like this:&lt;/p&gt;
&lt;p&gt;var q = db.Orders.Where(o =&amp;gt; o.OrderID == 10248);&lt;/p&gt;
&lt;p&gt;var order = q.First();&lt;/p&gt;
&lt;p&gt;var products = q.SelectMany(o =&amp;gt; o.Order_Details, (o, d) =&amp;gt; d.Product);&lt;/p&gt;
&lt;p&gt;foreach (var product in products) {&lt;/p&gt;
&lt;p&gt;// ...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I get the expected SQL. Can you shed any light on why I am getting this strange behaivor?&lt;/p&gt;
&lt;p&gt;-- Sincerely Anders&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9642361</link><pubDate>Wed, 27 May 2009 00:51:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9642361</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Hi Anders,&lt;/p&gt;
&lt;p&gt;I will try to explain. The SelectMany() is equivalent to:&lt;/p&gt;
&lt;p&gt;from od in order.Order_Details&lt;/p&gt;
&lt;p&gt;from p in od.Product&lt;/p&gt;
&lt;p&gt;select p;&lt;/p&gt;
&lt;p&gt;using this syntax, we are building a single query that will be analyzed by the Linq to Sql engine to generate a sql join.&lt;/p&gt;
&lt;p&gt;if you are writing:&lt;/p&gt;
&lt;p&gt;var product in order.Order_Details.Select()&lt;/p&gt;
&lt;p&gt;the &amp;quot;order.Order_Details&amp;quot; is not part of the Linq to Sql expression. It's a classical Linq to object syntax that will raise the lazy loading system.&lt;/p&gt;
&lt;p&gt;I don't know what you really want to query but you could even make just one query with something like:&lt;/p&gt;
&lt;p&gt;from o in &lt;/p&gt;
&lt;p&gt; &amp;nbsp;db.Orders.Where(o =&amp;gt; o.OrderID == 10248).Take(1)&lt;/p&gt;
&lt;p&gt;from od in order.Order_Details&lt;/p&gt;
&lt;p&gt;from p in od.Product&lt;/p&gt;
&lt;p&gt;select p;&lt;/p&gt;
&lt;p&gt;Take(1) returns an enumeration of 1 element which is different from First() which is returning the element itself &amp;gt;&amp;gt; no deferred execution.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9644009</link><pubDate>Wed, 27 May 2009 11:34:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9644009</guid><dc:creator>Anders Madsen</dc:creator><description>&lt;p&gt;Hi Mitsu,and thanks for the explanation!&lt;/p&gt;
&lt;p&gt;But perhaps I should try to explain a bit better. What I am trying to do is, to define a property on an object that can be used to iterate over a many-to-many relation, like the pattern you are describing in the post.&lt;/p&gt;
&lt;p&gt;With Northwind as an example, I am trying to define a property on an Order that returns a list of the products in it, basically like the one you have defined above:&lt;/p&gt;
&lt;p&gt;Public IEnumerable&amp;lt;Product&amp;gt; Products&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return Order_Details.Select(od =&amp;gt; od.Product);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;However, as I described in my first post this particular statement doesn't generate the SQL I would expect. I think I can follow your explanation, but I am unsure how to procede from here.&lt;/p&gt;
&lt;p&gt;Is the only way to have Linq generate inner join SQL statements to start fromv the datacontext each time? If so, the choice is simple - either use one global datacontext or a lot of locals and a lot of messing with the attach method. Neither options seem super apealing to me.&lt;/p&gt;
&lt;p&gt;But just to make sure, if I have an Order object from somewhere (fx. First()) the only way to define a property on it that generates a proper inner join sql statement is something like this:&lt;/p&gt;
&lt;p&gt;public IEnumerable&amp;lt;Product&amp;gt; Products2&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;get&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var dc = new NorthwindDataContext();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return dc.Order_Details&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Where(x =&amp;gt; x.OrderID == this.OrderID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.Select(x =&amp;gt; x.Product);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I just seems strange to me that the EntitySet doesn't understand to do this by itself, but maybe thats just me...&lt;/p&gt;
&lt;p&gt;-- Sincerely Anders&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9644766</link><pubDate>Wed, 27 May 2009 21:17:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9644766</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;I see,&lt;/p&gt;
&lt;p&gt;We try not to mix the model and the way we are loading data. For a single model you could have different ways to load data depending where you are in your application. You can just solve the model you want by creating properties and playing with EntitySets and then use LoadOptions to define how you want the data to be retrieved. (see DataContext.LoadOptions and DeferredLoadingEnabled)&lt;/p&gt;
&lt;p&gt;Mitsu&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9853135</link><pubDate>Thu, 30 Jul 2009 12:38:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9853135</guid><dc:creator>Someone</dc:creator><description>&lt;p&gt;Nice technique, but for our use, there is one problem: the use of &amp;quot;Singleton&amp;lt;NorthwindDataContext&amp;gt;.Default&amp;quot;. That will connect to the default database. In our case, the many-to-many mapping is in a different database.&lt;/p&gt;
&lt;p&gt;I will sort-of fix this by passing the data context to various accessors, and by changing the single-item cache to a Dictionary&amp;lt;DBDataContext, ListSelector&amp;lt;Order_Detail, Product&amp;gt;&amp;gt;&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9889373</link><pubDate>Mon, 31 Aug 2009 17:50:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9889373</guid><dc:creator>weng3998@hotmail.com</dc:creator><description>&lt;p&gt;Hi Mitsu, May I use &amp;quot;ListSelector&amp;quot; In EDM ?&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9889385</link><pubDate>Mon, 31 Aug 2009 18:28:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9889385</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Weng, two answers:&lt;/p&gt;
&lt;p&gt;1- EDM allows to map a many-to-many relationship. So you don't need to use this code.&lt;/p&gt;
&lt;p&gt;2- If you do not map the relationship inside EDM, you can use the ListSelector. Actually, the ListSelector can be used to create n-n relations between any kind of collections, even just memory collections.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9890417</link><pubDate>Wed, 02 Sep 2009 17:45:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9890417</guid><dc:creator>weng3998@hotmail.com</dc:creator><description>&lt;p&gt;Thanks &amp;nbsp;Mitsu ,&lt;/p&gt;
&lt;p&gt; I want use ListSelector in &amp;nbsp; many to many with payload, even no foreign key in &amp;nbsp;database .&lt;/p&gt;
&lt;p&gt;When I add ListSelector.cs &amp;nbsp;as exist item , &amp;nbsp;the “AsListSelector” is not apeared.&lt;/p&gt;
&lt;p&gt;That means &amp;nbsp;this.Order_Details.AsListSelector(od =&amp;gt; od.Product) is not right . &amp;nbsp; I don’t know how can let AsListSelector for Order_Details.&lt;/p&gt;
&lt;p&gt;In LINQ to SQL , we use &amp;nbsp;EntitSet , in EDM we use EntityCollection. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The same operation for LINQ to SQL ,I changed nothing ,it is useful . But for EDM not useful . &amp;nbsp;Can you give me some help . &amp;nbsp;&lt;/p&gt;
&lt;p&gt;qian weng &lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9890598</link><pubDate>Thu, 03 Sep 2009 00:43:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9890598</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;Weng,&lt;/p&gt;
&lt;p&gt;To make a extension method accessible, you must add a &amp;quot;using&amp;quot; to the namespace containing the method definition.&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9892649</link><pubDate>Tue, 08 Sep 2009 19:09:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9892649</guid><dc:creator>weng3998@hotmail.com</dc:creator><description>&lt;p&gt;Mitsu&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; I have changed namespace &amp;nbsp;for this class , so &amp;nbsp;they are in same namespace , May I send the code to you ? &lt;/p&gt;
&lt;p&gt;best &lt;/p&gt;
&lt;p&gt;weng &lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9892663</link><pubDate>Tue, 08 Sep 2009 19:27:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9892663</guid><dc:creator>mitsu</dc:creator><description>&lt;p&gt;And the method is still not accessible ?&lt;/p&gt;
</description></item><item><title>re: How to implement a many-to-many relationship using Linq to Sql ?</title><link>http://blogs.msdn.com/mitsu/archive/2007/06/21/how-to-implement-a-many-to-many-relationship-using-linq-to-sql.aspx#9892672</link><pubDate>Tue, 08 Sep 2009 19:39:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9892672</guid><dc:creator>weng3998@hotmail.com</dc:creator><description>&lt;p&gt;Mitsu&lt;/p&gt;
&lt;p&gt; products = this.Order_Details.AsListSelector(od =&amp;gt; od.Product);&lt;/p&gt;
&lt;p&gt;the error message &lt;/p&gt;
&lt;p&gt;Error	1	'd_ListSelector.Order' does not contain a definition for 'Order_Details' and no extension method 'Order_Details' accepting a first argument of type 'd_ListSelector.Order' could be found (are you missing a using directive or an assembly reference?)	C:\temp\d_ListSelector\d_ListSelector\Northwind.custom.cs	16	37	d_ListSelector&lt;/p&gt;
</description></item></channel></rss>