SelectMany Translation for an Equi-join Expression in C# LINQ

var query7 = from c in CustomerList from o in OrderList where c.Country == "USA" &amp;&amp; o.CustomerID == c.CustomerID select new { o, c }; //Translates to: query7 = from c in CustomerList.SelectMany(o =&gt; OrderList, (c, o) =&gt; <div><a href="http://cialisonline-canadian.com/">http://cialisonline-canadian.com/</a><a href="http://cialisincanada-cheap.com/">buy cialis online canada</a><a href="http://cialisincanada-cheap.com/">online cialis</a><a href="http://pharmacyincanada-onlineon.com/#online-canadian-pharmacy">canada pharmacy viagra</a><a href="http://viagracanadian-online.com/" title="serendipity and viagra">serendipity and viagra</a><a href="http://pharmacycanadian-onlinein.com/">pharmacy in canada</a><a href="http://viagraincanada-online.com/">buy viagra online</a><a href="http://pharmacycanadian-onlinein.com/#cialis-online-canadian-pharmacy">pharmacy in canada</a><a href="http://cialisonline-canadian.com/">generic cialis</a></div>  new { c, o }) where (c.c.Country == "USA") &amp;&amp; (c.o.CustomerID == c.c.CustomerID) select new { c.o, c.c }; foreach (var x in query7) sbResult.Append(String.Format("CustomerID = {0}, CompanyName = {1}, OrderID = {2}\r\n", x.o.CustomerID, x.c.CompanyName, x.o.OrderID));

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.