public void ExecuteCommand(IDbCommand command, bool commit) { try { if (commit) { using (MySqlConnection connection = new MySqlConnection(this.connectionString)) { connection.Open(); command.Connection = connection; int numberOfRows = command.ExecuteNonQuery(); } } else { databaseContext.AddCommand(command); command.ExecuteNonQuery(); } } catch (Exception ex) { throw ex; } }