System.Web.Caching.Cache.Remove C# (CSharp) Method

Remove() public method

public Remove ( string key ) : object
key string
return object
		public object Remove (string key)
		{
			return Remove (key, CacheItemRemovedReason.Removed, true, true);
		}
		

Same methods

Cache::Remove ( string key, CacheItemRemovedReason reason, bool doLock, bool invokeCallback ) : object

Usage Example

Example #1
0
        public void Put(string key, object value)
        {
            Ensure.NotNullOrWhiteSpace(key, "key");
            Ensure.NotNull(value, "value");

            string cacheKey = GetCacheKey(key);

            if (cache[cacheKey] != null)
            {
                cache.Remove(cacheKey);
            }

            if (!rootCacheKeyStored)
            {
                StoreRootCacheKey();
            }

            cache.Insert(cacheKey,
                         new DictionaryEntry(key, value),
                         new CacheDependency(null, new[] { rootCacheKey }),
                         System.Web.Caching.Cache.NoAbsoluteExpiration,
                         this.Expiration,
                         this.Priority,
                         null);
        }
All Usage Examples Of System.Web.Caching.Cache::Remove