title: Linq to SQL: Using int? as a parameter in a query
body: <p>So I have a query that looks something like this:</p>
  
  <pre><code>var clams = from clam in Clams
              where clam.ClamTypeID == 143 &amp;&amp;
                    clam.ParentClamID == null
              select clam;
  </code></pre>
  
  <p>Nothing too crazy, returns the results that I need.  But when I have it in a function where I'm passing in the possible null value as a int? I start to run into an issue.  Here is what my function looks like:</p>
  
  <pre><code>public IQueryable&lt;Clam&gt; getAllClams(int clamTypeID, int? parentClamID)
  {
       return from clam in Clams
              where clam.ClamTypeID == clamTypeID &amp;&amp;
                    clam.ParentClamID == parentClamID
              select clam;
  }
  </code></pre>
  
  <p>This function returns nothing - I checked the params to make sure they were correct and sure enough, parentClamID == null and still, no results. If I change clam.ParentClamID == parentClamID to clam.ParentClamID == null it works so I'm assuming I'm using int? incorrectly...any idea's what I'm doing wrong here?</p>