title: PetaPoco ExecuteScalar with nullable Guid
body: <p>I'm scratching my head trying to work out why petapoco's "Exists()" returns a false where it should return true. I use something like this to test:</p>
  
  <p>A simple petapoco model:</p>
  
  <pre><code>[TableName("WorkLog")]
  [PrimaryKey("Id")]
  public class WorkLog : DefaultConnectionDB.Record&lt;WorkLog&gt;
  {
       public int Id { get; set; }
       public Guid? Customer { get; set; }
       public Guid? Project { get; set; }
  }
  </code></pre>
  
  <p>A database table with the same structure as above, filled with Id's and Customers (only nulls for Project).</p>
  
  <p>Create a test object:</p>
  
  <pre><code>var x = new WorkLog {Id = 0, Customer = 'xxx-xxx-xxx...', Project = null}
  </code></pre>
  
  <p>Query if a the Worklog exists in DB, based on "Project":</p>
  
  <pre><code>var exist = db.Exists&lt;WorkLog&gt;("Project=@p", new { p = x.Project });
  </code></pre>
  
  <p>The result is "false" in this scenario. If I fill model, db and query with a Guid for Project it returns "true" like it should though.</p>
  
  <p>So I guess this has something to do with null and DbNull comparison, but I can't seem to find the right place to dig. I've tried with a helper method for converting "null" to "DbNull" before query, but it still returns false. </p>
  
  <p><strong>Temporary solution:</strong></p>
  
  <p>Currently I've solved this by doing...</p>
  
  <pre><code>var exist = db.Exists&lt;WorkLog&gt;(x.Project == null ? "Project IS NULL" : "Project=@p", new { p = x.Project });
  </code></pre>
  
  <p>This now works as expected, but I'd rather the method could be called normally and still return the expected result.</p>