diff --git a/RepoDb.Core/RepoDb/Operations/BaseRepository/InsertAll.cs b/RepoDb.Core/RepoDb/Operations/BaseRepository/InsertAll.cs index d1cdecf4b..deb39c2fd 100644 --- a/RepoDb.Core/RepoDb/Operations/BaseRepository/InsertAll.cs +++ b/RepoDb.Core/RepoDb/Operations/BaseRepository/InsertAll.cs @@ -17,16 +17,19 @@ public abstract partial class BaseRepository : IDisposab /// /// The data entity objects to be inserted. /// The batch size of the insertion. + /// The mapping list of objects to be used. /// The table hints to be used. /// The transaction to be used. /// The number of inserted rows in the table. public int InsertAll(IEnumerable entities, int batchSize = Constant.DefaultBatchOperationSize, + IEnumerable fields = null, string hints = null, IDbTransaction transaction = null) { return DbRepository.InsertAll(entities: entities, batchSize: batchSize, + fields: fields, hints: hints, transaction: transaction); } @@ -40,16 +43,19 @@ public int InsertAll(IEnumerable entities, /// /// The data entity objects to be inserted. /// The batch size of the insertion. + /// The mapping list of objects to be used. /// The table hints to be used. /// The transaction to be used. /// The number of inserted rows in the table. public Task InsertAllAsync(IEnumerable entities, int batchSize = Constant.DefaultBatchOperationSize, + IEnumerable fields = null, string hints = null, IDbTransaction transaction = null) { return DbRepository.InsertAllAsync(entities: entities, batchSize: batchSize, + fields: fields, hints: hints, transaction: transaction); } diff --git a/RepoDb.Core/RepoDb/Operations/DbConnection/InsertAll.cs b/RepoDb.Core/RepoDb/Operations/DbConnection/InsertAll.cs index 0ebcddd8c..b9079eaeb 100644 --- a/RepoDb.Core/RepoDb/Operations/DbConnection/InsertAll.cs +++ b/RepoDb.Core/RepoDb/Operations/DbConnection/InsertAll.cs @@ -65,6 +65,7 @@ public static int InsertAll(this IDbConnection connection, /// The connection object to be used. /// The list of data entity objects to be inserted. /// The batch size of the insertion. + /// The mapping list of objects to be used. /// The table hints to be used. /// The command timeout in seconds to be used. /// The transaction to be used. @@ -74,6 +75,7 @@ public static int InsertAll(this IDbConnection connection, public static int InsertAll(this IDbConnection connection, IEnumerable entities, int batchSize = Constant.DefaultBatchOperationSize, + IEnumerable fields = null, string hints = null, int? commandTimeout = null, IDbTransaction transaction = null, @@ -85,6 +87,7 @@ public static int InsertAll(this IDbConnection connection, tableName: ClassMappedNameCache.Get(), entities: entities, batchSize: batchSize, + fields: fields, hints: hints, commandTimeout: commandTimeout, transaction: transaction, @@ -166,7 +169,7 @@ public static Task InsertAllAsync(this IDbConnection connection, tableName: tableName, entities: entities, batchSize: batchSize, - fields: GetQualifiedFields(fields, entities?.FirstOrDefault()), + fields: fields, hints: hints, commandTimeout: commandTimeout, transaction: transaction, @@ -181,6 +184,7 @@ public static Task InsertAllAsync(this IDbConnection connection, /// The connection object to be used. /// The list of data entity objects to be inserted. /// The batch size of the insertion. + /// The mapping list of objects to be used. /// The table hints to be used. /// The command timeout in seconds to be used. /// The transaction to be used. @@ -190,6 +194,7 @@ public static Task InsertAllAsync(this IDbConnection connection, public static Task InsertAllAsync(this IDbConnection connection, IEnumerable entities, int batchSize = Constant.DefaultBatchOperationSize, + IEnumerable fields = null, string hints = null, int? commandTimeout = null, IDbTransaction transaction = null, @@ -201,6 +206,7 @@ public static Task InsertAllAsync(this IDbConnection connection, tableName: ClassMappedNameCache.Get(), entities: entities, batchSize: batchSize, + fields: fields, hints: hints, commandTimeout: commandTimeout, transaction: transaction, @@ -276,7 +282,7 @@ public static int InsertAll(this IDbConnection connection, ITrace trace = null, IStatementBuilder statementBuilder = null) { - return InsertAllInternal(connection: connection, + return InsertAllInternal(connection: connection, tableName: tableName, entities: entities, batchSize: batchSize, @@ -317,7 +323,7 @@ public static Task InsertAllAsync(this IDbConnection connection, ITrace trace = null, IStatementBuilder statementBuilder = null) { - return InsertAllAsyncInternal(connection: connection, + return InsertAllAsyncInternal(connection: connection, tableName: tableName, entities: entities, batchSize: batchSize, diff --git a/RepoDb.Core/RepoDb/Operations/DbRepository/InsertAll.cs b/RepoDb.Core/RepoDb/Operations/DbRepository/InsertAll.cs index d1f18f3b3..3f783746f 100644 --- a/RepoDb.Core/RepoDb/Operations/DbRepository/InsertAll.cs +++ b/RepoDb.Core/RepoDb/Operations/DbRepository/InsertAll.cs @@ -67,11 +67,13 @@ public int InsertAll(string tableName, /// The type of the data entity. /// The data entity objects to be inserted. /// The batch size of the insertion. + /// The mapping list of objects to be used. /// The table hints to be used. /// The transaction to be used. /// The number of inserted rows in the table. public int InsertAll(IEnumerable entities, int batchSize = Constant.DefaultBatchOperationSize, + IEnumerable fields = null, string hints = null, IDbTransaction transaction = null) where TEntity : class @@ -84,6 +86,7 @@ public int InsertAll(IEnumerable entities, // Call the method return connection.InsertAll(entities: entities, batchSize: batchSize, + fields: fields, hints: hints, commandTimeout: CommandTimeout, transaction: transaction, @@ -159,11 +162,13 @@ public async Task InsertAllAsync(string tableName, /// The type of the data entity. /// The data entity objects to be inserted. /// The batch size of the insertion. + /// The mapping list of objects to be used. /// The table hints to be used. /// The transaction to be used. /// The number of inserted rows in the table. public async Task InsertAllAsync(IEnumerable entities, int batchSize = Constant.DefaultBatchOperationSize, + IEnumerable fields = null, string hints = null, IDbTransaction transaction = null) where TEntity : class @@ -176,6 +181,7 @@ public async Task InsertAllAsync(IEnumerable entities, // Call the method return await connection.InsertAllAsync(entities: entities, batchSize: batchSize, + fields: fields, hints: hints, commandTimeout: CommandTimeout, transaction: transaction,