/// <summary> /// Inserts multiple data in the database. /// </summary> /// <param name="entities">The data entity objects to be inserted.</param> /// <param name="transaction">The transaction to be used.</param> /// <param name="batchSize">The batch size of the insertion.</param> /// <returns>The number of inserted rows.</returns> public void InsertAll(IEnumerable <TEntity> entities, int batchSize = Constant.DefaultBatchOperationSize, IDbTransaction transaction = null) { DbRepository.InsertAll <TEntity>(entities: entities, batchSize: batchSize, transaction: transaction); }
/// <summary> /// Inserts the multiple data entity objects (as new rows) in the table. /// </summary> /// <param name="entities">The data entity objects to be inserted.</param> /// <param name="hints">The table hints to be used.</param> /// <param name="transaction">The transaction to be used.</param> /// <param name="batchSize">The batch size of the insertion.</param> /// <returns>The number of inserted rows in the table.</returns> public int InsertAll(IEnumerable <TEntity> entities, int batchSize = Constant.DefaultBatchOperationSize, string hints = null, IDbTransaction transaction = null) { return(DbRepository.InsertAll <TEntity>(entities: entities, batchSize: batchSize, hints: hints, transaction: transaction)); }
/// <summary> /// Insert multiple rows in the table. /// </summary> /// <param name="tableName">The name of the target table to be used.</param> /// <param name="entities">The data entity objects to be inserted.</param> /// <param name="batchSize">The batch size of the insertion.</param> /// <param name="fields">The mapping list of <see cref="Field"/> objects to be used.</param> /// <param name="hints">The table hints to be used.</param> /// <param name="transaction">The transaction to be used.</param> /// <returns>The number of inserted rows in the table.</returns> public int InsertAll(string tableName, IEnumerable <TEntity> entities, int batchSize = Constant.DefaultBatchOperationSize, IEnumerable <Field> fields = null, string hints = null, IDbTransaction transaction = null) { return(DbRepository.InsertAll <TEntity>(tableName: tableName, entities: entities, batchSize: batchSize, fields: fields, hints: hints, transaction: transaction)); }