title: LINQ join with OR
body: <p>I want to do a JOIN with LINQ using an OR statement.</p>
  
  <p>Here is the SQL query I'm starting with:</p>
  
  <pre><code>SELECT  t.id
  FROM Teams t
  INNER JOIN Games g 
     ON (g.homeTeamId = t.id OR g.awayTeamId = t.id) 
    AND g.winningTeamId != 0
    AND g.year = @year
  GROUP BY t.id
  </code></pre>
  
  <p>I'm having trouble converting that ON clause to LINQ.  This is where I'm at:</p>
  
  <pre><code>var y = from t in db.Teams
          join g in db.Games on t.ID equals g.AwayTeamID //missing HomeTeamID join
          where g.WinningTeamID != 0
             &amp;&amp; g.Year == year
          group t by t.ID into grouping
          select grouping;
  </code></pre>
  
  <p>I think I could use:</p>
  
  <pre><code>join g in db.Games on 1 equals 1
  where (t.ID == g.HomeTeamID || t.ID == g.AwayTeamID)
  </code></pre>
  
  <p>and this works but seems kind of seems hacky.  Is there a better way? </p>