forked from ddrilling/AsbCloudServer
Обход бага .net
This commit is contained in:
parent
1e878aaa03
commit
59a86e4c4b
@ -24,7 +24,8 @@ namespace AsbCloudInfrastructure.Services.Cache
|
|||||||
|
|
||||||
public int Refresh()
|
public int Refresh()
|
||||||
{
|
{
|
||||||
cached.Clear();
|
if(cached.Any())
|
||||||
|
cached.Clear();
|
||||||
var dbEntities = context.Set<TEntity>().ToList();
|
var dbEntities = context.Set<TEntity>().ToList();
|
||||||
cached.AddRange(dbEntities);
|
cached.AddRange(dbEntities);
|
||||||
data.refreshDate = DateTime.Now;
|
data.refreshDate = DateTime.Now;
|
||||||
@ -33,7 +34,8 @@ namespace AsbCloudInfrastructure.Services.Cache
|
|||||||
|
|
||||||
public async Task<int> RefreshAsync(CancellationToken token = default)
|
public async Task<int> RefreshAsync(CancellationToken token = default)
|
||||||
{
|
{
|
||||||
cached.Clear();
|
if (cached.Any())
|
||||||
|
cached.Clear();
|
||||||
var dbEntities = await context.Set<TEntity>().ToListAsync(token).ConfigureAwait(false);
|
var dbEntities = await context.Set<TEntity>().ToListAsync(token).ConfigureAwait(false);
|
||||||
cached.AddRange(dbEntities);
|
cached.AddRange(dbEntities);
|
||||||
data.refreshDate = DateTime.Now;
|
data.refreshDate = DateTime.Now;
|
||||||
|
Loading…
Reference in New Issue
Block a user