title: Use LINQ to Join on Multiple Fields
body: <p>How would I do this in LINQ?</p>
  
  <pre><code>SQL
  
  Where tblAccounts.AccountCode = tblAccountAssociations.ChildCode
  And tblAccountAssociations.AssociationType = "DS"
  </code></pre>
  
  <p>Here is my attempt.  The problem seems to be with "assoc.AssociationType == "DS".  Is it part of the join or the Where clause?</p>
  
  <pre><code>var customers = 
      from customer in context.tblAccounts 
      join assoc in context.tblAccountAssociations on customer.AccountCode equals assoc.ChildCode 
      where customer.AccountType == "S" and assoc.AssociationType == "DS" 
      orderby customer.AccountType 
      select new { Customer = customer, Assoc = assoc };
  </code></pre>
  
  <p>Thanks in advance</p>