title: Null reference exception in linq select statement
body: <p>I am getting a null reference exception from my bellow linq query. I have a table with an entityID(reference to another table to get translated text), but in some case i don't have proper translated text in my child table. This case i need to  take lookupName field text and assign to lookupName field.</p>
  
  <pre><code> await _context.FormLookup.Where(x=&gt;!(x.isDeleted))
                  .Select(x =&gt; new LookupList() { 
                      lookupID = x.lookupID, 
                      TransilatedName = _context.TranslatedText.FirstOrDefault(z =&gt; z.entityID == x.entityID &amp;&amp; z.languageId == language &amp;&amp; !(z.isDeleted)).languageText, 
                      lookupName = x.lookupName, 
                      itemCount = x.lookupDetails.Count(),
                      parent = x.parentID
                  }).ToListAsync();
  </code></pre>
  
  <p>I need to add a condition like </p>
  
  <pre><code>TransilatedName = _context.TranslatedText.FirstOrDefault(z =&gt; z.entityID == x.entityID &amp;&amp; z.languageId == language &amp;&amp; !(z.isDeleted)) != null ? TransilatedName = _context.TranslatedText.FirstOrDefault(z =&gt; z.entityID == x.entityID &amp;&amp; z.languageId == language &amp;&amp; !(z.isDeleted)).languageText : x.lookupName,
  </code></pre>
  
  <p>Any suggestions?</p>