title: Linq & ASP.NET MVC: how to use "or" and "equals" in join statement
body: <p>How to translate this sql query in a linq query, please?</p>
  
  <pre><code>USE [BiblioDB]
   GO
   SELECT *
     FROM Exemplaire e
      LEFT JOIN location l
      ON e.ExemplaireId = l.ExemplaireId
      INNER JOIN Retour r
      ON l.LocationId is null or l.LocationId = r.LocationId
   Go
  </code></pre>
  
  <p>I tried this linq query but the fourth line doesn't work.</p>
  
  <pre><code> BiblioDBContext biblioDBContext = new BiblioDBContext();
   var query = from e in biblioDBContext.Exemplaires
             join l in biblioDBContext.Locations on e.ExemplaireId equals l.LocationId
             join r in biblioDBContext.Retours on l.LocationId == null || l.LocationId equals r.LocationId r.LocationId
   select e;
  </code></pre>