예제 #1
0
 /// <summary>
 /// Inserts multiple data in the database in an asynchronous way.
 /// </summary>
 /// <param name="entities">The data entity objects to be inserted.</param>
 /// <param name="batchSize">The batch size of the insertion.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of inserted rows.</returns>
 public Task InsertAllAsync(IEnumerable <TEntity> entities,
                            int batchSize = Constant.DefaultBatchOperationSize,
                            IDbTransaction transaction = null)
 {
     return(DbRepository.InsertAllAsync <TEntity>(entities: entities,
                                                  batchSize: batchSize,
                                                  transaction: transaction));
 }
예제 #2
0
 /// <summary>
 /// Insert multiple rows in the table in an asynchronous way.
 /// </summary>
 /// <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 Task <int> InsertAllAsync(IEnumerable <TEntity> entities,
                                  int batchSize = Constant.DefaultBatchOperationSize,
                                  IEnumerable <Field> fields = null,
                                  string hints = null,
                                  IDbTransaction transaction = null)
 {
     return(DbRepository.InsertAllAsync <TEntity>(entities: entities,
                                                  batchSize: batchSize,
                                                  fields: fields,
                                                  hints: hints,
                                                  transaction: transaction));
 }