title: LINQ Select if not null
body: <p>I'm trying to do something like this:</p>
  
  <pre><code>int? id = invoices.Where(l =&gt; l.OrganisationID == part.OrganisationID)
                    .Select(m =&gt; m.TypeID).FirstOrDefault();
  </code></pre>
  
  <p>'invoices' is a <code>List</code></p>
  
  <p>But <code>invoices.Where(l =&gt; l.OrganisationID == part.OrganisationID)</code> might be null, in which case <code>id</code> needs to be a new <code>Nullable&lt;int&gt;</code>.</p>
  
  <p>How can I do this in one line (and efficiently) rather than first checking if the object is null or not?</p>