title: send parameters when call to a stored procedure through SqlMapper.Query in C#
body: <p>I have following SP call </p>
  
  <pre><code>        public IEnumerable&lt;classfile&gt; GetData(bool isactive)
          {
              using (SqlConnection cnn = this.OpenConnection())
              {
  
                   IList&lt;classfile&gt; SampleList = SqlMapper.Query&lt;classfile&gt;(cnn, "SPName").ToList();
  
                  cnn.Close();
  
                  return SampleList.ToList();
              }
          }
  </code></pre>
  
  <p>How can I send parameters along with above dapper SP call</p>
  
  <p>I tried following </p>
  
  <pre><code>        public IEnumerable&lt;classfile&gt; GetData(bool isactive)
          {
              using (SqlConnection cnn = this.OpenConnection())
              {
                   var parameters = new DynamicParameters();
                   parameters.Add("@isActive", isactive);
  
                   IList&lt;classfile&gt; SampleList = SqlMapper.Query&lt;classfile&gt;(cnn, "SPName", parameters).ToList();
  
                  cnn.Close();
  
                  return SampleList.ToList();
              }
          }
  </code></pre>
  
  <p>but its run time getting error as following </p>
  
  <blockquote>
    <p>Procedure or function 'SPName' expects parameter '@isActive', which
    was not supplied.</p>
  </blockquote>