From 595b106c6bcfda288fafdf54c27b5a8378f1e430 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Mon, 5 Feb 2024 13:11:33 +0100 Subject: [PATCH] Update ImageFileCache.cs --- MapControl/Shared/ImageFileCache.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/MapControl/Shared/ImageFileCache.cs b/MapControl/Shared/ImageFileCache.cs index c25c136e..9d37dc78 100644 --- a/MapControl/Shared/ImageFileCache.cs +++ b/MapControl/Shared/ImageFileCache.cs @@ -65,7 +65,12 @@ namespace MapControl.Caching { if (expiration.Value > DateTimeOffset.UtcNow) { - memoryCache.Set(key, buffer, new DistributedCacheEntryOptions { AbsoluteExpiration = expiration }); + var cacheOptions = new DistributedCacheEntryOptions + { + AbsoluteExpiration = expiration + }; + + memoryCache.Set(key, buffer, cacheOptions); } else { @@ -104,7 +109,12 @@ namespace MapControl.Caching { if (expiration.Value > DateTimeOffset.UtcNow) { - await memoryCache.SetAsync(key, buffer, new DistributedCacheEntryOptions { AbsoluteExpiration = expiration }, token).ConfigureAwait(false); + var cacheOptions = new DistributedCacheEntryOptions + { + AbsoluteExpiration = expiration + }; + + await memoryCache.SetAsync(key, buffer, cacheOptions, token).ConfigureAwait(false); } else {