From 24024b5729c1c44bb01cb29813868743d1753e31 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 24 Dec 2021 16:22:03 +0300 Subject: MergeTool, MemoryUtil anf stuff --- Source/Assistant/MemoryCacheExtensions.cs | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 Source/Assistant/MemoryCacheExtensions.cs (limited to 'Source/Assistant/MemoryCacheExtensions.cs') diff --git a/Source/Assistant/MemoryCacheExtensions.cs b/Source/Assistant/MemoryCacheExtensions.cs deleted file mode 100644 index 7eb1408..0000000 --- a/Source/Assistant/MemoryCacheExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Runtime.Caching; -using System.Threading.Tasks; - -namespace RehauSku.Assistant -{ - static class MemoryCacheExtensions - { - public static bool IsCached(this string request) - { - return MemoryCache.Default.Contains(request); - } - - public static IProduct GetFromCache(this string request) - { - return MemoryCache.Default[request] as IProduct; - } - - public static async Task RequestAndCache(this string request) - { - IProduct product = await SkuAssist.GetProductAsync(request); - - if (product == null) - return null; - - MemoryCache.Default.Add(request, product, DateTime.Now.AddMinutes(10)); - return product; - } - } -} \ No newline at end of file -- cgit v1.2.3