예제 #1
0
 /// <summary>
 /// Merges the multiple data entity objects into the database.
 /// </summary>
 /// <param name="entities">The list of data entity objects to be merged.</param>
 /// <param name="batchSize">The batch size of the merge operation.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public int MergeAll(IEnumerable <TEntity> entities,
                     int batchSize = Constant.DefaultBatchOperationSize,
                     IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAll <TEntity>(entities: entities,
                                            batchSize: batchSize,
                                            transaction: transaction));
 }
예제 #2
0
 /// <summary>
 /// Insert multiple rows or update the existing rows in the table.
 /// </summary>
 /// <param name="entities">The list of data entity objects to be merged.</param>
 /// <param name="batchSize">The batch size of the merge operation.</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 affected rows during the merge process.</returns>
 public int MergeAll(IEnumerable <TEntity> entities,
                     int batchSize = Constant.DefaultBatchOperationSize,
                     IEnumerable <Field> fields = null,
                     string hints = null,
                     IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAll <TEntity>(entities: entities,
                                            batchSize: batchSize,
                                            fields: fields,
                                            hints: hints,
                                            transaction: transaction));
 }
예제 #3
0
 /// <summary>
 /// Insert the multiple data entity objects (as new rows) or update the existing rows in the table. This merge operation only works like upsert, it does not do any deletion.
 /// </summary>
 /// <param name="entities">The list of entity objects to be merged.</param>
 /// <param name="qualifiers">The expression for the qualifier fields.</param>
 /// <param name="batchSize">The batch size of the merge operation.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of affected rows during the merge process.</returns>
 public int MergeAll(IEnumerable <TEntity> entities,
                     Expression <Func <TEntity, object> > qualifiers,
                     int batchSize = Constant.DefaultBatchOperationSize,
                     string hints  = null,
                     IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAll <TEntity>(entities: entities,
                                            qualifiers: qualifiers,
                                            batchSize: batchSize,
                                            hints: hints,
                                            transaction: transaction));
 }