From 195802e87fb95d07273a04780ceec29c388aad0c Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 27 Jan 2022 01:45:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/BootstrapAdmin.Caching/CacheManager.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.Caching/CacheManager.cs b/src/blazor/admin/BootstrapAdmin.Caching/CacheManager.cs index d19efa09..0cd9b6d0 100644 --- a/src/blazor/admin/BootstrapAdmin.Caching/CacheManager.cs +++ b/src/blazor/admin/BootstrapAdmin.Caching/CacheManager.cs @@ -28,17 +28,11 @@ public static class CacheManager /// /// /// - public static TItem GetOrAdd(string key, Func valueFactory) - { - return Cache.GetOrAdd(key, valueFactory); - } + public static TItem GetOrAdd(string key, Func valueFactory) => Cache.GetOrAdd(key, valueFactory); /// /// 清除指定键值缓存项 /// /// - public static void Clear(string? key) - { - Cache.Clear(key); - } + public static void Clear(string? key = null) => Cache.Clear(key); }