title: null vs default(decimal?) set to null - giving different results
body: <blockquote>
    <p>Using: Entity Framework 4.3.1, MVC 4</p>
  </blockquote>
  
  <p>Sample database records (for example):</p>
  
  <pre>
  Id    Height
  1     null  
  2     2.1
  </pre>
  
  <p>Why does this first statement bring back zero results:</p>
  
  <pre><code>decimal? scannedItemHeight = default(decimal?);
  
  (from st in Stocks
   where st.Height == scannedItemHeight 
   select st.Id).ToList();
  </code></pre>
  
  <p>But this statement returns record Id 1:</p>
  
  <pre><code>(from st in Stocks
   where st.Height == null
   select st.Id).ToList();
  </code></pre>
  
  <p>If scannedItemHeight is null, I only want to match values where the height is null too.</p>
  
  <p>I only want to return the first record, Id 1.</p>
  
  <p><strong>UPDATE</strong>
  I ended up using:</p>
  
  <pre><code>st.Height == scannedItemHeight || (scannedItemHeight == null &amp;&amp; st.Height == null)
  </code></pre>