コード例 #1
0
 private IValueWrapper FindInCaches(CacheOperationContext context, string key, Type returnType)
 {
     foreach (var cache in context.Caches)
     {
         var result = cache.Get(key, returnType);
         if (result != null)
         {
             return(result);
         }
     }
     return(null);
 }
コード例 #2
0
        private void performCacheEvict(
            CacheOperationContext context, CacheEvictOperation operation, object result)
        {
            var key = "";

            foreach (var cache in context.Caches)
            {
                if (operation.CacheWide)
                {
                    cache.Clear();
                }
                else
                {
                    if (key.IsNullOrWhiteSpace())
                    {
                        key = context.GenerateKey(result);
                    }
                    cache.Evict(key);
                }
            }
        }
コード例 #3
0
 public CachePutRequest(CacheOperationContext context, object key)
 {
     this.context = context;
     this.key     = key;
 }