Skip to content

Commit 2ede3ad

Browse files
committed
Align caching behaviour on BaseRepository
1 parent f1e3dde commit 2ede3ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

RepoDb.Core/RepoDb/BaseRepository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,14 @@ public IEnumerable<TEntity> ExecuteQuery(string commandText,
316316
object param = null,
317317
CommandType? commandType = null,
318318
string cacheKey = null,
319-
int? cacheItemExpiration = Constant.DefaultCacheItemExpirationInMinutes,
319+
int? cacheItemExpiration = null,
320320
IDbTransaction transaction = null)
321321
{
322322
return DbRepository.ExecuteQuery<TEntity>(commandText: commandText,
323323
param: param,
324324
commandType: commandType,
325325
cacheKey: cacheKey,
326-
cacheItemExpiration: cacheItemExpiration,
326+
cacheItemExpiration: cacheItemExpiration ?? CacheItemExpiration,
327327
transaction: transaction);
328328
}
329329

@@ -354,15 +354,15 @@ public Task<IEnumerable<TEntity>> ExecuteQueryAsync(string commandText,
354354
object param = null,
355355
CommandType? commandType = null,
356356
string cacheKey = null,
357-
int? cacheItemExpiration = Constant.DefaultCacheItemExpirationInMinutes,
357+
int? cacheItemExpiration = null,
358358
IDbTransaction transaction = null,
359359
CancellationToken cancellationToken = default)
360360
{
361361
return DbRepository.ExecuteQueryAsync<TEntity>(commandText: commandText,
362362
param: param,
363363
commandType: commandType,
364364
cacheKey: cacheKey,
365-
cacheItemExpiration: cacheItemExpiration,
365+
cacheItemExpiration: cacheItemExpiration ?? CacheItemExpiration,
366366
transaction: transaction,
367367
cancellationToken: cancellationToken);
368368
}

0 commit comments

Comments
 (0)