我想从特定缓存中删除特定缓存值。如何从特定缓存中删除特定密钥的特定值从缓存中删除特定缓存中的特定缓存值
实施例:
Cache.Insert("TestCacheKey", "111", null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration, CacheItemPriority.High,null);
Cache.Insert("TestCacheKey", "222", null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
Cache.Insert("TestCacheKey", "333", null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
所以,我在与键即TestCacheKey
关联的高速缓存加了一些数据,如上所示。现在,我想从该密钥中删除一个特定的值,即“111”,即TestCacheKey
。删除该特定值后,当我检索该缓存键(TestCacheKey
)时,我应该只获取其余两个记录,其值为与该密钥关联的值“222”&“333”。
那么,如何才能实现从缓存中删除特定值。
你可以托运缓存类的签名。 – Seabizkit
你可以plz张贴你的代码 –