title: Linq join query with left outer join throwing object reference not found
body: <p>I have a list and two tables. (This is a very simplified version of the actual schema, but should work for the question)</p>
  
  <p><strong>List_A</strong><br>
  FPI<br>
  1<br>
  2<br>
  3<br>
  4<br></p>
  
  <p><strong>Table_B</strong><br>
  FPI_______NI<br>
  2_________1<br>
  4_________2<br></p>
  
  <p><strong>Table_C</strong><br>
  NI_______Name<br>
  1_________x<br>
  2_________y<br></p>
  
  <p>My linq query:</p>
  
  <pre><code>(from a in List_A
   join b in Table_B on a.FPI equals b.FPI into ab
   from b in ab.DefaultIfEmpty()
   join c in Table_C on b.FI equals c.FI into bc
   from c in bc.DefaultIfEmpty()
   select new {
     FPI = a.FPI,
     Name = c?.Name}).ToList();
  </code></pre>
  
  <p>this code throws an exception that <code>Object reference not set to an instance of an object.</code>.
  After a lot of trial and experiment, I have reached to a conclusion that in the second join when i'm doing <code>b.FI equals c.FI</code>, at that time it is failing for the entries for which there is no value in the Table_B.<br></p>
  
  <p>The expected output of the query should be<br>
  <strong>ABC</strong>
  FPI____NI___Name<br>
  1_____null__null<br>
  2_____1_____x   <br>
  3_____null__null<br>
  4_____2_____y   <br></p>
  
  <p><br>
  I'm not sure why this error is coming and what would be the best solution for this problem.</p>