title: Linq query Left Join condition
body: <p>I'm trying to recreate the following sql query using Linq syntax, for some reason it is not working, please let me know what am I doing wrong here</p>
  
  <h2>My sql query:</h2>
  
  <pre><code>select 
  cf.VisitConfigId,
  cf.VisitName,
  sv.VisitDate 
  from SubjectVisitConfig cf 
  left join SubjectVisit sv on cf.VisitConfigId = sv.VisitConfigId
  </code></pre>
  
  <h2>My Linq query:</h2>
  
  <pre><code>var q = from cf in ctms.SubjectVisitConfigs
          join sv in ctms.SubjectVisits on cf.VisitConfigId equals  
          sv.VisitConfigId into JoinedVisits
          from sv in JoinedVisits.DefaultIfEmpty()
          where sv.SubjectId == subjectId.Value &amp;&amp; sv.SiteId == siteId.Value
          select new
          {
              sv.VisitId,
              VisitDate = sv.VisitDate != null ? sv.VisitDate : null,
              cf.VisitName
          };
  </code></pre>
  
  <p>Thanks for your help!</p>