title: View SQL statment to be executed in Dapper
body: <p>I will like to know if is possible to see what the SQL statement actully looks after the parameters have been parsed in to the SQL string. For example given the following code:</p>
  
  <pre><code>const string SQL = @"
  SELECT *
     FROM V_PROVIDER_WAGE_OVER_REVENUE
  WHERE SITE_ID = :SITE_ID 
     AND VENDOR_ID = :VENDOR_ID
     AND date_paid &gt;= :DATE_FROM 
     AND date_paid &lt;= :DATE_TO;";
  
  conn.Query&lt;ProviderWageOverRevenueModel&gt;(SQL, new { 
       VENDOR_ID = vendorId, 
       SITE_ID = siteId, 
       DATE_FROM = dateFrom, 
       DATE_TO = dateTo 
  }).ToList();
  </code></pre>
  
  <p>I will like to know if at some point (maybe inside Dapper source?) can I see the something like:</p>
  
  <pre><code>SELECT *
     FROM V_PROVIDER_WAGE_OVER_REVENUE
  WHERE SITE_ID = 199
     AND VENDOR_ID = 17
     AND date_paid &gt;= '01/01/2014' 
     AND date_paid &lt;= '20/11/2014';
  </code></pre>
  
  <h3>Edit</h3>
  
  <p>I was assuming that the parameters placeholders will be replaced with the values, however according after looking closely at the source of Dapper I realize that its just relaying on a iDbCommand to executed the query, so after looking at this <a href="https://stackoverflow.com/questions/2789476/is-it-possible-to-get-the-parsed-text-of-a-sqlcommand-with-sqlparameters">question</a> It is possible to see executed statement inside .Net?</p>
  
  <p>I try this:</p>
  
  <pre><code>string query = cmd.CommandText;
  foreach (DbParameter p in cmd.Parameters)
  {
      query = query.Replace(p.ParameterName, p.Value.ToString());
  }
  </code></pre>
  
  <p>however the result is not seem to be like I hope:</p>
  
  <pre><code>SELECT *
      FROM V_PROVIDER_WAGE_OVER_REVENUE
  WHERE 23411127316 = :23411127316 
      AND 23411076816 = :23411076816
      AND date_paid &gt;= :1/07/2014 10:11:34 PM 
      AND date_paid &lt;= :12/12/2014 12:00:00 AM;
  </code></pre>