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