Beispiel #1
0
        /// <summary>
        /// 移除缓存
        /// </summary>
        /// <param name="key">缓存键</param>
        /// <param name="cacheType">缓存类型(默认是Memcached)</param>
        /// <returns></returns>
        public static bool Remove(string key, CacheTypeEnum cacheType = CacheTypeEnum.Default)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                return(false);
            }
            switch (cacheType)
            {
            case CacheTypeEnum.Memcached:
            case CacheTypeEnum.Default:
            default:
                return(Memcached.DelCache(key));

            case CacheTypeEnum.HttpRuntime:
                return(RuntimeCache.DelCache(key));
            }
        }