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)); }
/// <summary> /// This is to delete / remove the item from redis based on key; /// </summary> /// <returns></returns> public bool RemoveItem() { return(_repositoryCache.Remove(_cacheKey)); }
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)); }
public virtual void Remove(string key) { appFabricCache.Remove(GetFormatedKey(key)); }