Обход бага .net

This commit is contained in:
Фролов 2021-07-29 12:36:29 +05:00
parent 1e878aaa03
commit 59a86e4c4b

View File

@ -24,6 +24,7 @@ namespace AsbCloudInfrastructure.Services.Cache
public int Refresh()
{
if(cached.Any())
cached.Clear();
var dbEntities = context.Set<TEntity>().ToList();
cached.AddRange(dbEntities);
@ -33,6 +34,7 @@ namespace AsbCloudInfrastructure.Services.Cache
public async Task<int> RefreshAsync(CancellationToken token = default)
{
if (cached.Any())
cached.Clear();
var dbEntities = await context.Set<TEntity>().ToListAsync(token).ConfigureAwait(false);
cached.AddRange(dbEntities);