Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BatchCommander"/> class.
 /// </summary>
 /// <param name="db">The db.</param>
 /// <param name="batchSize">Size of the batch.</param>
 /// <param name="tran">The tran.</param>
 public BatchCommander(IDatabase db, BatchOptions option, IDbTransaction tran)
 {
     if (option.BatchSize < 1)
     {
         option.BatchSize = 10;
     }
     Option         = option;
     this.db        = db;
     this.batchSize = option.BatchSize;
     batchCommands  = new List <IDbCommand>(batchSize);
     this.tran      = tran;
     if (tran != null)
     {
         isUsingOutsideTransaction = true;
     }
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BatchCommander"/> class.
 /// </summary>
 /// <param name="db">The db.</param>
 /// <param name="batchSize">Size of the batch.</param>
 public BatchCommander(Database db, BatchOptions option)
     : this(db, option, db.Transaction)
 {
     isUsingOutsideTransaction = false;
 }