title: Linq to Entities Querying for Nullable data types
body: <p>I got a scenario where we are doing soft delete on the rows in database. I want to include the rows that are not deleted. How can I achieve it using LINQ.</p>
  
  <p>Say</p>
  
  <pre><code>from c in context.ASDSet
  where (c =&gt; c.DeletedFlag.HasValue &amp;&amp; !c.DeletedFlag.Value)
  </code></pre>
  
  <p>But I couldn't achieve the result.</p>
  
  <p>I want the resultant SQL to be of form:</p>
  
  <pre><code>select *  from table where IsNull(column, 0) = 0
  </code></pre>