From 85c33eb0f848b983159fe1e631ec436533c53b58 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 9 Dec 2024 17:18:24 +0100 Subject: [PATCH] refactor(CacheExtensions): Umbenennung der GetOrCreate-Methoden in GetOrSet --- EnvelopeGenerator.Application/Extensions/CacheExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Application/Extensions/CacheExtensions.cs b/EnvelopeGenerator.Application/Extensions/CacheExtensions.cs index d8986131..45f43109 100644 --- a/EnvelopeGenerator.Application/Extensions/CacheExtensions.cs +++ b/EnvelopeGenerator.Application/Extensions/CacheExtensions.cs @@ -33,7 +33,7 @@ namespace EnvelopeGenerator.Application.Extensions return value is null ? null : new(BitConverter.ToInt64(value, 0)); } - public static string GetOrCreate(this IDistributedCache cache, string key, Func factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken token = default) + public static string GetOrSet(this IDistributedCache cache, string key, Func factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken token = default) { var value = cache.GetString(key); if (value is null) @@ -58,7 +58,7 @@ namespace EnvelopeGenerator.Application.Extensions return value; } - public static async Task GetOrCreateAsync(this IDistributedCache cache, string key, Func> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken token = default) + public static async Task GetOrSetAsync(this IDistributedCache cache, string key, Func> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken token = default) { var value = await cache.GetStringAsync(key, token: token); if(value is null)