title: Get return value from stored procedure
body: <p>I'm using Entity Framework 5 with the Code First approach. I need to read the return value from a stored procedure; I am already reading output parameters and sending input parameters, but I don't know how to read the return value.</p>
  
  <p>Is it possible?</p>
  
  <p>Here is the code that I use to call the stored procedure:</p>
  
  <pre><code>var outParam = new SqlParameter();
  outParam.ParameterName = "@StatusLog";
  outParam.SqlDbType = SqlDbType.NVarChar;
  outParam.Size = 4000;
  outParam.Direction = ParameterDirection.Output;
  
  var code = new SqlParameter();
  code.ParameterName = "@Code";
  code.Direction = ParameterDirection.Input;
  code.SqlDbType = SqlDbType.VarChar;
  code.Size = 20;
  code.Value = "123";
  
  var data = _context.Database.SqlQuery&lt;Item&gt;("exec spItemData @Code, @StatusLog OUT", code, outParam);
  
  var result = data.FirstOrDefault();
  </code></pre>