title: how to check null value in linq to sql
body: <p>I am trying to use following linq to sql query to get result. But it doesn't works if parentCategoryId  passed as null</p>
  
  <pre><code> public static IEnumerable&lt;Category&gt; GetChildren(this Table&lt;Category&gt; source, int? parentCategoryId)
      {
          var categories = from c in source where c.ParenCategoryId == parentCategoryId select c;
          return categories;
      }   
  </code></pre>
  
  <p>but  following works if null used directly in place of parentCategoryId</p>
  
  <pre><code> public static IEnumerable&lt;Category&gt; GetChildren(this Table&lt;Category&gt; source, int? parentCategoryId)
      {
          var categories = from c in source where c.ParenCategoryId == null select c;
          return categories;
      }
  </code></pre>