From 6c9a8b4e355a663000532a463b4d7daeb75ed7b1 Mon Sep 17 00:00:00 2001 From: Michael Camara Pendon Date: Tue, 6 Sep 2022 23:38:45 +0200 Subject: [PATCH] #1044 Support to the DbRepository.ExecuteQueryMultiple. --- RepoDb.Core/RepoDb/DbRepository.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/RepoDb.Core/RepoDb/DbRepository.cs b/RepoDb.Core/RepoDb/DbRepository.cs index cca3bb058..b21decef1 100644 --- a/RepoDb.Core/RepoDb/DbRepository.cs +++ b/RepoDb.Core/RepoDb/DbRepository.cs @@ -852,12 +852,17 @@ public async Task ExecuteScalarAsync(string commandText, /// , , and an enumerable of objects. /// /// The command type to be used. + /// + /// The key to the cache item. By setting this argument, it will return the item from the cache if present, otherwise it will query the database. + /// This will only work if the 'cache' argument is set. + /// /// The command timeout in seconds to be used. /// The transaction to be used. /// An instance of used to extract the results. public QueryMultipleExtractor ExecuteQueryMultiple(string commandText, object param = null, CommandType? commandType = null, + string cacheKey = null, int? commandTimeout = null, IDbTransaction transaction = null) { @@ -874,8 +879,11 @@ public QueryMultipleExtractor ExecuteQueryMultiple(string commandText, return connection.ExecuteQueryMultipleInternal(commandText: commandText, param: param, commandType: commandType, + cacheKey: cacheKey, + cacheItemExpiration: CacheItemExpiration, commandTimeout: commandTimeout, transaction: transaction, + cache: Cache, isDisposeConnection: isDisposeConnection); } @@ -892,6 +900,10 @@ public QueryMultipleExtractor ExecuteQueryMultiple(string commandText, /// , , and an enumerable of objects. /// /// The command type to be used. + /// + /// The key to the cache item. By setting this argument, it will return the item from the cache if present, otherwise it will query the database. + /// This will only work if the 'cache' argument is set. + /// /// The command timeout in seconds to be used. /// The transaction to be used. /// The object to be used during the asynchronous operation. @@ -899,6 +911,7 @@ public QueryMultipleExtractor ExecuteQueryMultiple(string commandText, public Task ExecuteQueryMultipleAsync(string commandText, object param = null, CommandType? commandType = null, + string cacheKey = null, int? commandTimeout = null, IDbTransaction transaction = null, CancellationToken cancellationToken = default) @@ -916,8 +929,11 @@ public Task ExecuteQueryMultipleAsync(string commandText return connection.ExecuteQueryMultipleAsyncInternal(commandText: commandText, param: param, commandType: commandType, + cacheKey: cacheKey, + cacheItemExpiration: CacheItemExpiration, commandTimeout: commandTimeout, transaction: transaction, + cache: Cache, isDisposeConnection: isDisposeConnection, cancellationToken: cancellationToken); }