title: dapper query - fix for "Unclosed quotation mark near ..." error
body: <p>This query works; that is, it returns the expected results:</p>
  
  <pre><code>var r = sql.Query&lt;T&gt;("select * from TableName where Name = '" + name + "'");
  </code></pre>
  
  <p>but, if one of the 'names' values contains an apostrophy (which is true), then an exception is thrown '{"Incorrect syntax near 'Resources'.\r\nUnclosed quotation mark after the character string ''."}' - in an attempt to <a href="https://stackoverflow.com/a/17412205/3259125">fix that problem</a>, my query no longer returns any results; but it should.</p>
  
  <p>I've attempted to change the code in a few ways, but no results are returned with either of the following changes:</p>
  
  <pre><code>var r = sql.Query&lt;T&gt;("select * from TableName where Name = '@name'", new { name });
  </code></pre>
  
  <p>or</p>
  
  <pre><code>var args = new DynamicParameters(name);
  var r = sql.Query&lt;T&gt;("select * from TableName where Name = '@name'", args);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>var args = new DynamicParameters(); args.AddDynamicParams(new { name });
  var r = sql.Query&lt;T&gt;("select * from TableName where Name = '@name'", args);
  </code></pre>
  
  <p>or </p>
  
  <pre><code>var args = new DynamicParameters(); args.Add("@name", name);
  var r = sql.Query&lt;T&gt;("select * from TableName where Name = '@name'", args);
  </code></pre>
  
  <p>This is probably something trivial that I have simply just not yet grasped the concept for ... but I'm at the point of having spent too much time trying to figure it out - hence the question.</p>