title: Function or method to exclude parameters with null values in Dapper
body: <p>I want to pass three values and get result according to that using Dapper, but other attributes in that class automatically taking null values and i want to neglect those parameters.
  Now I am just passing say param1 and trying to get result. However my object as param2 and param3</p>
  
  <pre><code>connection.Query&lt;T&gt;("Query statement", whereConditions)
  </code></pre>
  
  <p>The whereConditions is object with param1, param2 and param3. However the result use where clause from param which has values and ignore the nulls</p>
  
  <p>[UPDATE]</p>
  
  <p>Query </p>
  
  <pre><code>select ID, UserName, Screen, Url, LogAction from LogTable 
  Where UserName = 'Joe' and Screen = 'edit' and LogAction = 'delete'
  </code></pre>
  
  <p>Now From the UI, I am not sure if I will receive Username or Screen or Action. I can get any one of them of all three. My query has to change accordingly </p>
  
  <p>If I create an anonymus object  </p>
  
  <pre><code>var whereConditions = new { UserName = "Joe", Screen = "edit" }
  </code></pre>
  
  <p>It works well but in case of another parameter I need to pass it as </p>
  
  <pre><code>var whereConditions = new { UserName = "Joe", Screen = "edit", LogAction = "save" }
  </code></pre>
  
  <p>So I need to understand How can pass the anonymous object as where condition.</p>
  
  <p>Hope this help</p>