title: LINQtoSQL LEFT JOIN on 1 to 1 relation, method-based
body: <p>Say I have 2 table on 1 to 1 or 0 relation like so:</p>
  
  <pre><code>Invoice: ID, Date, OrderID
  Order:   ID, Date, Notes (string)
  </code></pre>
  
  <p>as far as the LINQtoSQL i have the INNER JOIN as:</p>
  
  <pre><code>customer
  .invoices
  .OrderByDescending(i =&gt; i.Date)
  .Join(context.Orders,
      invoice =&gt; invoice.OrderID,
      order =&gt; order.OrderID,
      (invoice, order) =&gt; new
      {
          invoice = invoice,
          OrderNotes = order.Notes
      })
  .ToList()
  </code></pre>
  
  <p>All values that are excluded in the inner join is <code>WHERE Invoice.OrderID NOT IN (SELECT OrderID FROM Order)</code>, I have not checked what happens <code>WHERE Invoice.OrderID IS NULL</code></p>
  
  <p>the query that is desired is:</p>
  
  <pre><code>SELECT i.*, o.Notes AS OrderNotes 
  FROM 
      Invoice AS i
  LEFT OUTER JOIN 
      Order AS o
  ON i.OrderID = o.OrderID
  </code></pre>
  
  <p>i understand that the fk's should be switched around, but i don't have the power to change the structure of the DB.</p>
  
  <p>I don't know how to produce LEFT OUTER JOIN effect. looking around I only found solutions for 1 to many LEFT JOIN.</p>