ningshuxia
2025-04-11 3c285bbed129d8bfe21fa2c83bddb68f434bc2af
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace IStation.Service
{
    internal class CacheKeyHelper
    {
        private const string _cacheKeyPrefix = "*Default_Basic_Prefix*";//缓存键前缀
 
        /// <summary>
        /// 查询缓存键
        /// </summary>
        public static string GetCacheKey(string keyContent)
        {
            return string.Format("{0}_{1}", _cacheKeyPrefix, keyContent);
        }
 
        /// <summary>
        /// 清除全部
        /// </summary>
        public static void Clear()
        {
            MemoryCacheHelper.Remove((key) =>
            {
                return key.StartsWith(_cacheKeyPrefix);
            });
        }
 
    }
}