title: Return Values from Dapper.net query with stored procedure
body: <p>I am trying to call a stored procedure <code>using Dapper.Net</code> and get return values.</p>
  
  <pre><code>p.Add("@INCIDENT_ID", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue);
  
  var retResults = con.Execute("usp_GetIncidentID", p, commandType:CommandType.StoredProcedure);
  
  int IncidentID = p.Get&lt;int&gt;("INCIDENT_ID"); 
  </code></pre>
  
  <p>I have tried a couple of different things with the parameter direction and using the <code>"@INCIDENT_ID"</code>. If you step through the results, you can see that the proper return values are coming down in the <code>retResults</code> value, but I am not able to access the values the way it is described in the documentation as below..</p>
  
  <p>Stored Procedures
  Dapper supports fully stored procs:</p>
  
  <pre><code>var user = cnn.Query&lt;User&gt;("spGetUser", new {Id = 1}, 
      commandType: CommandType.StoredProcedure).First();}}}
  If you want something more fancy, you can do:
  
  var p = new DynamicParameters();
  p.Add("@a", 11);
  p.Add("@b", dbType: DbType.Int32, direction: ParameterDirection.Output);
  p.Add("@c", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue);
  
  cnn.Execute("spMagicProc", p, commandType: commandType.StoredProcedure); 
  
  int b = p.Get&lt;int&gt;("@b");
  int c = p.Get&lt;int&gt;("@c");   
  </code></pre>