SQL query to LINQ Translation (LEFT JOIN and NULL Values)
<p>I'm trying to "translate" a SQL query to LINQ, and until now without success.</p>

<p>This is my SQL query that returns one result with several columns with null values (correct output):</p>

<pre><code>SELECT patient.idPatient, removed, fat.status AS FATstatus, fad.status AS FADstatus,
fa.status AS FAstatus, fdv.status AS FDVstatus, ffu.status AS FFUstatus, fmbct.status
AS FMBCTstatus, fnt.status AS FNTstatus, fs.status AS FSstatus, ftd.status AS FTDstatus  
FROM patient 
LEFT JOIN FormAdjuvantTreatment fat ON patient.idPatient = fat.idPatient
LEFT JOIN FormAdvancedDisease fad ON patient.idPatient = fad.idPatient
LEFT JOIN FormAnamnesis fa ON patient.idPatient = fa.idPatient
LEFT JOIN FormDemoVariables fdv ON patient.idPatient = fdv.idPatient
LEFT JOIN FormFollowUp ffu ON patient.idPatient = ffu.idPatient
LEFT JOIN FormMBCTreatment fmbct ON patient.idPatient = fmbct.idPatient
LEFT JOIN FormNeoadjuvantTreatment fnt ON patient.idPatient = fnt.idPatient
LEFT JOIN FormSurgery fs ON patient.idPatient = fs.idPatient
LEFT JOIN FormTumorDisease ftd ON patient.idPatient = ftd.idPatient
WHERE patient.idResearcher = '01-01';
</code></pre>

<p>This is my translated LINQ query. I doesn't return any  result (incorrect output):</p>

<pre><code>var query = (from u in db.Patients.DefaultIfEmpty()
join fat in db.FormAdjuvantTreatments on u.idPatient equals fat.idPatient
join fad in db.FormAdvancedDiseases on u.idPatient equals fad.idPatient
join fa in db.FormAnamnesis on u.idPatient equals fa.idPatient
join fdv in db.FormDemoVariables on u.idPatient equals fdv.idPatient
join ffu in db.FormFollowUps on u.idPatient equals ffu.idPatient
join fmbct in db.FormMBCTreatments on u.idPatient equals fmbct.idPatient
join fnt in db.FormNeoadjuvantTreatments on u.idPatient equals fnt.idPatient
join fs in db.FormSurgeries on u.idPatient equals fs.idPatient
join ftd in db.FormTumorDiseases on u.idPatient equals ftd.idPatient
where u.idResearcher == idResearcher
select new
{
   u.idPatient,
   u.removed,
   FormAdjuvantTreatment = (fat.status == null ? "NULL" : fat.status),
   FormAdvancedDisease = (fad.status == null ? "NULL" : fad.status),
   FormAnamnesi = (fa.status == null ? "NULL" : fa.status),
   FormDemoVariable = (fdv.status == null ? "NULL" : fdv.status),
   FormFollowUp = (ffu.status == null ? "NULL" : ffu.status),
   FormMBCTreatment = (fmbct.status == null ? "NULL" : fmbct.status),
   FormNeoadjuvantTreatment = (fnt.status == null ? "NULL" : fnt.status),
   FormSurgery = (fs.status == null ? "NULL" : fs.status),
   FormTumorDisease = (ftd.status == null ? "NULL" : ftd.status),
}).ToList();
</code></pre>
