title: Dapper output parameter is not returning values
body: <p>This is my code part:</p>
  
  <pre><code>CResponseVO objCResponseVO = new CResponseVO();
  
  try
  {
    var parameters = new DynamicParameters();
    parameters.Add("@UserId", currentUser.userId, DbType.Int32);
    parameters.Add("@Operation", operation, DbType.String);
    parameters.Add("@Output", dbType: DbType.Int32, direction: ParameterDirection.Output);
  
    using (var connection = SqlAccessHelper.SqlHelper.GetOpenConnection(SqlConnectionHelper.SqlConnectionString()))
    {
      var reader = connection.QueryMultiple("USP_DataExtract", parameters, (SqlTransaction)null, 1000000, CommandType.StoredProcedure);
      int result = parameters.Get&lt;int&gt;("@Output");
      if (operation != "insert")
      {
        ObservableCollection&lt;DataExtraction.DataExtractionTracker&gt; DataExtractionTracker = new ObservableCollection&lt;DataExtraction.DataExtractionTracker&gt;(reader.Read&lt;DataExtraction.DataExtractionTracker&gt;());
        objCResponseVO.addObject("ExtractionStatus", DataExtractionTracker);
      }
  
    objResponseVO.Result = result;
  }
  </code></pre>
  
  <p>This is my SP, and I have used <code>try</code> and <code>catch</code> to commit or rollback based on ouput parameter value:</p>
  
  <pre><code>@UserID int=0,
  @Operation varchar(50)= NULL,
  @Output INT OUTPUT
  
  AS
  BEGIN
    BEGIN TRY
      BEGIN TRANSACTION
        If(@Operation = 'select')
        BEGIN
          SELECT RequestId, UserId, RequestTime, Status,DownloadPath from DataExtractTracker where UserId= @UserID
        END
  
        If(@Operation = 'insert')
        BEGIN
          Insert into DataExtractTracker( UserId, RequestTime, Status) values (@UserID, GETDATE(), 'Waiting')
        END
        SET @Output = 0
      COMMIT TRANSACTION
    END TRY
    BEGIN CATCH
      ROLLBACK TRANSACTION
      SET @Output = 1 
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      SELECT @ErrorMessage = ERROR_MESSAGE(), @ErrorSeverity = ERROR_SEVERITY(),  @ErrorState = ERROR_STATE();
  
      -- Use RAISERROR inside the CATCH block to return 
      -- error information about the original error that 
      -- caused execution to jump to the CATCH block.
      RAISERROR (@ErrorMessage, -- Message text.
                 @ErrorSeverity, -- Severity.
                 @ErrorState -- State.);
    END CATCH
  END
  </code></pre>
  
  <p>However, I am not able to retrieve the ouput parameter value. I am getting an exception when executing:</p>
  
  <pre><code>int result = parameters.Get&lt;int&gt;("@Output");
  </code></pre>
  
  <p>Exception says something like this:</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object.</p>
  </blockquote>