title: Cross-Join Syntax in Entity Framework / IQueryable
body: <p>I'm trying to deepen my education about IQueryable custom providers and expression trees.  I'm interested in custom parsing a cross-join (viz. SelectMany), and I'm trying to understand if that is exactly what EF is doing when it handles this:</p>
  <pre><code>var infoQuery =
      from cust in db.Customers
      from ord in cust.Orders
      where cust.City == &quot;London&quot;
      select ord;
  </code></pre>
  <p>Allegedly <a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/ea0fc561-3148-4afd-8b1f-01b49a23a4a7/" rel="nofollow noreferrer">EF can handle cross joins</a>, though the syntax in that link does not look right to me.  Then I found a link with the title &quot;<a href="http://msdn.microsoft.com/en-us/library/bb399397.aspx" rel="nofollow noreferrer">Cross Product Queries</a>&quot; for EF.  The syntax looks &quot;correct,&quot; but the article itself speaks as if these are normal inner joins rather than cross joins.</p>
  <p>Indeed, the code snippet above comes from that last article - and leaves me wondering if EF simply says &quot;I know how these two entities are related, so I will form the inner-join automatically.&quot;</p>
  <p>What is the real story with EF and this alleged &quot;cross join&quot; sample?</p>
  <h2>footnote</h2>
  <p>As I try to build my own IQueryable LINQ provider, the <em>educational</em> goal I've set for myself is to make my own query context for the code snippet above, so that when ToList() is called on the query:</p>
  <ol>
  <li>A Console.WriteLine() is automatically fired that prints &quot;This is a cross join of:<code>Customer</code> and <code>Order</code></li>
  <li>The <code>==</code> operator is magically converted into a <code>!=</code> before the query is fully interpreted (by an <a href="http://msdn.microsoft.com/en-us/library/system.linq.expressions.expressionvisitor.aspx" rel="nofollow noreferrer">ExpressionVisitor</a> perhaps, not sure).</li>
  </ol>
  <p>If someone knows of articles or has snippets of code that would speed my educational goal, please do share! :)</p>