protected bool Remove(string key, string region)
        {
            if (string.IsNullOrEmpty(region))
            {
                return(appFabricCache.Remove(key));
            }

            return(appFabricCache.Remove(key, region));
        }
        /// <summary>
        /// The remote all where.
        /// </summary>
        /// <param name="dataCache">
        /// The data cache.
        /// </param>
        /// <param name="whereFunc">
        /// The where function.
        /// </param>
        /// <typeparam name="T">
        /// </typeparam>
        public static void RemoveAllWhere <T>(
            [NotNull] this IDataCache <T> dataCache, [NotNull] Func <KeyValuePair <string, T>, bool> whereFunc)
        {
            CodeContracts.ArgumentNotNull(dataCache, "dataCache");
            CodeContracts.ArgumentNotNull(whereFunc, "whereFunc");

            dataCache.GetAll().Where(whereFunc).ForEach(i => dataCache.Remove(i.Key));
        }
示例#3
0
/// <summary>
/// This is to delete / remove the item from redis based on key;
/// </summary>
/// <returns></returns>
        public bool RemoveItem()
        {
            return(_repositoryCache.Remove(_cacheKey));
        }
示例#4
0
 public void TestRemove()
 {
     _cache.Remove("k2");
     Assert.IsFalse(_cache.Contains("k2"));
 }
        /// <summary>
        /// The remote all.
        /// </summary>
        /// <param name="dataCache">
        /// The data cache.
        /// </param>
        /// <typeparam name="T">
        /// </typeparam>
        public static void RemoveAll <T>([NotNull] this IDataCache <T> dataCache)
        {
            CodeContracts.ArgumentNotNull(dataCache, "dataCache");

            dataCache.GetAll().ForEach(i => dataCache.Remove(i.Key));
        }
示例#6
0
 public virtual void Remove(string key)
 {
     appFabricCache.Remove(GetFormatedKey(key));
 }