Exemplo n.º 1
0
        public static bool TryGetCache <T>(this ILocalCache cache, string cacheKey, out T val, DateTime?expiry = null)
        {
            object obj;

            if (cache.TryGetCache(cacheKey, out obj, expiry))
            {
                val = (T)obj;
                return(true);
            }
            val = default(T);
            return(false);
        }
Exemplo n.º 2
0
 protected override bool TryGetCache <TRtn>(string cacheType, string cacheKey, out TRtn rtn, Type rtnType = null)
 {
     return(_dictCache.TryGetCache <TRtn>(GetCacheKey(cacheType, cacheKey), out rtn));
 }