protected override int AddToBatch(IDbCommand command) { MySqlCommand mySqlCommand = (MySqlCommand)command; if (mySqlCommand.BatchableCommandText == null) { mySqlCommand.GetCommandTextForBatching(); } IDbCommand item = (IDbCommand)((ICloneable)command).Clone(); this.commandBatch.Add(item); return(this.commandBatch.Count - 1); }
protected override int AddToBatch(IDbCommand command) { // the first time each command is asked to be batched, we ask // that command to prepare its batchable command text. We only want // to do this one time for each command MySqlCommand commandToBatch = (MySqlCommand)command; if (commandToBatch.BatchableCommandText == null) { commandToBatch.GetCommandTextForBatching(); } IDbCommand cloneCommand = (IDbCommand)((ICloneable)command).Clone(); commandBatch.Add(cloneCommand); return(commandBatch.Count - 1); }