lixiaojun
2022-10-24 d8e0e34a10a0e0f65d4e8dfe83d612b6781facd1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace IStation
{
    internal sealed partial class SharedMemoryCache
    {
        /// <summary>
        /// See if the cache contains a specific cache key
        /// </summary>
        /// <param name="key">the cache key to look for</param>
        /// <returns>true if the supplied cache key was found</returns>
        public bool HasKey(string key)
        {
            if (key == null)
                return default;
            return _memoryCache.TryGetValue(key, out _);
        }
    }
}