コード例 #1
0
        /// <summary>
        /// 删除缓存
        /// </summary>
        /// <param name="key">缓存Key</param>
        /// <returns></returns>
        public static async Task Remove(string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentNullException(nameof(key));
            }
            switch (cacheProvider)
            {
            case Define.CACHEPROVIDER_REDIS:
                await BaseHelper.DelAsync(key);

                break;

            case Define.CACHEPROVIDER_MEMORY:
                MemoryCacheHelper.Remove(key);
                break;
            }
        }