Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public ICacheEntry <T> GetEntry <T>(string key) where T : class
 {
     return(CacheInfo.GetCacheEntry <T>(key));
 }
Exemplo n.º 4
0
 //???
 public ICacheEntry GetEntry(string key)
 {
     return(CacheInfo.GetCacheEntry(key));
 }