예제 #1
0
 public bool TryGetEntry <T>(string key, out ICacheEntry <T> value) where T : class
 {
     try
     {
         value = CacheInfo.GetCacheEntry <T>(key);
         return(true);
     }
     catch (Exception)
     {
         value = null;
         return(false);
     }
 }
예제 #2
0
        public IDictionary <string, ICacheEntry> GetAllEntries(string key = null, bool prefix = false)
        {
            var cacheEntries = new Dictionary <string, ICacheEntry>();
            var cacheKeys    = Keys().Where(k => (!prefix && (String.IsNullOrEmpty(key) || k == key)) || (prefix && k.StartsWith(key)));

            foreach (var cacheKey in cacheKeys)
            {
                //Should we just die on exceptions?
                try
                {
                    cacheEntries.Add(cacheKey, CacheInfo.GetCacheEntry(cacheKey));
                }
                catch (Exception)
                {
                }
            }
            return(cacheEntries);
        }
예제 #3
0
 public ICacheEntry <T> GetEntry <T>(string key) where T : class
 {
     return(CacheInfo.GetCacheEntry <T>(key));
 }
예제 #4
0
 //???
 public ICacheEntry GetEntry(string key)
 {
     return(CacheInfo.GetCacheEntry(key));
 }