我找到了!我可以使用必须以这种方式使用的输出参数读取返回值:
// define a new output parametervar returnCode = new SqlParameter();returnCode.ParameterName = "@ReturnCode";returnCode.SqlDbType = SqlDbType.Int;returnCode.Direction = ParameterDirection.Output;// assign the return pre to the new output parameter and pass it to the spvar data = _context.Database.SqlQuery<Item>("exec @ReturnCode = spItemData @Code, @StatusLog OUT", returnCode, pre, outParam);


