title: How to handle Null in LINQ Subquery?
body: <p>I've got a subquery that returns the most recent value from a child table. In some cases the subquery returns nothing.  The query below fails at runtime because the inferred type of MemberPrice is decimal and is not nullable.  </p>
  
  <p>Simplified query:</p>
  
  <pre><code>Dim q = From s In dc.STOCKs _
          Select s.ID, MemberPrice = _
            (From mp In dc.STOCKPRICEs Where mp.NUMBER = s.NUMBER _
            Order By dc.date Descending _
            Select mp.PRICE).FirstOrDefault
  </code></pre>
  
  <p>In SQL, the subquery would contain Top (1) and would return Null when empty. How can I handle this in LINQ? Is there a way to make MemberPrice nullable or default the value to zero if not found (or a more elegant solution)? </p>
  
  <p>Many thanks, Stuart</p>