mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +00:00
Refresh not supported
This commit is contained in:
parent
057fd82feb
commit
abd7567ffc
2 changed files with 27 additions and 27 deletions
|
|
@ -99,6 +99,11 @@ namespace MapControl.Caching
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<byte[]> GetAsync(string key, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
return Task.FromResult(Get(key));
|
||||||
|
}
|
||||||
|
|
||||||
public void Set(string key, byte[] value, DistributedCacheEntryOptions options)
|
public void Set(string key, byte[] value, DistributedCacheEntryOptions options)
|
||||||
{
|
{
|
||||||
CheckArguments(key, value, options);
|
CheckArguments(key, value, options);
|
||||||
|
|
@ -131,8 +136,21 @@ namespace MapControl.Caching
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
Set(key, value, options);
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
public void Refresh(string key)
|
public void Refresh(string key)
|
||||||
{
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task RefreshAsync(string key, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Remove(string key)
|
public void Remove(string key)
|
||||||
|
|
@ -149,6 +167,13 @@ namespace MapControl.Caching
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task RemoveAsync(string key, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
Remove(key);
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
public void DeleteExpiredItems()
|
public void DeleteExpiredItems()
|
||||||
{
|
{
|
||||||
var deleted = fileDb.DeleteRecords(new FilterExpression(expiresField, DateTime.UtcNow, ComparisonOperatorEnum.LessThanOrEqual));
|
var deleted = fileDb.DeleteRecords(new FilterExpression(expiresField, DateTime.UtcNow, ComparisonOperatorEnum.LessThanOrEqual));
|
||||||
|
|
@ -161,32 +186,6 @@ namespace MapControl.Caching
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<byte[]> GetAsync(string key, CancellationToken token = default)
|
|
||||||
{
|
|
||||||
return Task.FromResult(Get(key));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default)
|
|
||||||
{
|
|
||||||
Set(key, value, options);
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task RefreshAsync(string key, CancellationToken token = default)
|
|
||||||
{
|
|
||||||
Refresh(key);
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task RemoveAsync(string key, CancellationToken token = default)
|
|
||||||
{
|
|
||||||
Remove(key);
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void CheckArgument(string key)
|
private static void CheckArgument(string key)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(key))
|
if (string.IsNullOrEmpty(key))
|
||||||
|
|
|
||||||
|
|
@ -138,11 +138,12 @@ namespace MapControl.Caching
|
||||||
|
|
||||||
public void Refresh(string key)
|
public void Refresh(string key)
|
||||||
{
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task RefreshAsync(string key, CancellationToken token = default)
|
public Task RefreshAsync(string key, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
return Task.CompletedTask;
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Remove(string key)
|
public void Remove(string key)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue