title: I need return value from dapper execute insert
body: <p>BKG_AOR_CHANGE_SK is populated from a database trigger when the row is inserted. I need to retrieve this value as part of my insert. How would I go about doing that? I have tried this in order to get it as an output parameter, but it is doesn't return the value.</p>
  
  <pre><code>   public BKG_AOR_CHANGE BKG_AOR_CHANGE_Create(BKG_AOR_CHANGE dto)
      {
          try
          {
              var parameters = new DynamicParameters();
  
              parameters.Add(name: "MEMBER_ORIG_EFF_DT", value: dto.MEMBER_ORIG_EFF_DT, direction: ParameterDirection.Input);
              parameters.Add(name: "MEMBER_ID", value: dto.MEMBER_ID, direction: ParameterDirection.Input);
              parameters.Add(name: "MEMBER_NAME", value: dto.MEMBER_NAME, direction: ParameterDirection.Input);
              parameters.Add(name: "CUSTOMER_TYPE", value: dto.CUSTOMER_TYPE, direction: ParameterDirection.Input);
              parameters.Add(name: "CURR_AGENT_ID", value: dto.CURR_AGENT_ID, direction: ParameterDirection.Input);
              parameters.Add(name: "CURR_AGENT_NAME", value: dto.CURR_AGENT_NAME, direction: ParameterDirection.Input);
              parameters.Add(name: "CURR_AGENCY_ID", value: dto.CURR_AGENCY_ID, direction: ParameterDirection.Input);
              parameters.Add(name: "BKG_AOR_CHANGE_SK", direction: ParameterDirection.Output, size: 31);
  
              var sql = @"INSERT
                              INTO DS_BROKERAGE.BKG_AOR_CHANGE
                                (
                                  MEMBER_ORIG_EFF_DT,
                                  MEMBER_ID,
                                  MEMBER_NAME,
                                  CUSTOMER_TYPE,
                                  CURR_AGENT_ID,
                                  CURR_AGENT_NAME,
                                  CURR_AGENCY_ID,
                                )
                                VALUES
                                (
                                  :MEMBER_ORIG_EFF_DT,
                                  :MEMBER_ID,
                                  :MEMBER_NAME,
                                  :CUSTOMER_TYPE,
                                  :CURR_AGENT_ID,
                                  :CURR_AGENT_NAME,
                                  :CURR_AGENCY_ID,
                                )";
              this._db.Execute(sql, parameters);
  
              dto.BKG_AOR_CHANGE_SK = parameters.Get&lt;int&gt;("BKG_AOR_CHANGE_SK");
  
              return dto;
          }
          catch (Exception e)
          {
              throw e;
          }
      }
  </code></pre>