public IDbCommand CreateCommand() { IDbCommand result = _connection.CreateCommand(); #if DEBUG // Return a LoggingDbCommandWrapper to log all CommandText to logfile in DEBUG mode. result = new LoggingDbCommandWrapper(result); #endif result.Transaction = _transaction; return result; }
private object ExecuteScalar(string command) { using (MySqlConnection connection = new MySqlConnection(_connectionString)) { connection.Open(); IDbCommand cmd = connection.CreateCommand(); #if DEBUG // Return a LoggingDbCommandWrapper to log all CommandText to logfile in DEBUG mode. cmd = new LoggingDbCommandWrapper(cmd); #endif using (cmd) { cmd.CommandText = command; var result = cmd.ExecuteScalar(); return result; } } }
public IDbCommand CreateCommand() { IDbCommand result = _connection.CreateCommand(); if (_settings.EnableDebugLogging) result = new LoggingDbCommandWrapper(result); result.Transaction = _transaction; return result; }