GetTransaction() public method

public GetTransaction ( ) : DbTransaction
return System.Data.Common.DbTransaction
Example #1
0
        public virtual async Task NonQueryAsync(MapperDb db, DbCommand command)
        {
            var connection = db.GetConnection();
            if (connection == null)
            {
                throw new MapperException("Could not create database connection.");
            }

            await db.OpenSharedConnectionAsync().ConfigureAwait(false);
            command.Connection = connection;
            command.Transaction = db.GetTransaction();

            await command.ExecuteNonQueryAsync().ConfigureAwait(false);
        }