public GetLastAutoIncrementingID ( string tableName, IDbTransaction tran, IDbCommand command ) : long | ||
tableName | string | The name of the table inserted into |
tran | IDbTransaction | The current transaction, the one the insert was done in |
command | IDbCommand | The Command the did the insert statement |
return | long |
/// <summary> /// Carries out instructions after execution of the sql statement /// </summary> /// <param name="databaseConnection">The <see cref="DatabaseConnection"/> that executed the statement.</param> /// <param name="transaction">The <see cref="IDbTransaction"/> under which the <see cref="SqlStatement"/>'s command was run.</param> /// <param name="command">The <see cref="IDbCommand"/> that was used to execute the <see cref="SqlStatement"/>.</param> internal override void DoAfterExecute(DatabaseConnection databaseConnection, IDbTransaction transaction, IDbCommand command) { if (_supportsAutoIncrementingFIELD != null && _tableName != null) { var lastAutoIncrementingID = databaseConnection.GetLastAutoIncrementingID(_tableName, transaction, command); _supportsAutoIncrementingFIELD.SetAutoIncrementingFieldValue(lastAutoIncrementingID); } }
/// <summary> /// Carries out instructions after execution of the sql statement /// </summary> /// <param name="databaseConnection">The <see cref="DatabaseConnection"/> that executed the statement.</param> /// <param name="transaction">The <see cref="IDbTransaction"/> under which the <see cref="SqlStatement"/>'s command was run.</param> /// <param name="command">The <see cref="IDbCommand"/> that was used to execute the <see cref="SqlStatement"/>.</param> internal override void DoAfterExecute(DatabaseConnection databaseConnection, IDbTransaction transaction, IDbCommand command) { if (_supportsAutoIncrementingFIELD != null && _tableName != null) { var lastAutoIncrementingID = databaseConnection.GetLastAutoIncrementingID(_tableName, transaction, command); _supportsAutoIncrementingFIELD.SetAutoIncrementingFieldValue(lastAutoIncrementingID); } }