Exemplo n.º 1
0
        public override bool Contains(string key)
        {
            Purge();

            if (!_internalCache.Contains(key))
            {
                var token = cache.Get(key);
                if (token != null && token.SecurityToken != null)
                {
                    _internalCache.AddOrUpdate(token.Key, token.SecurityToken.DeserializeSecurityToken(_securityTokenSerializer), token.ExpirationTime);
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        public override bool Contains(string key)
        {
            Purge();

            if (!_internalCache.Contains(key))
            {
                ApiHelperAsync helper = new ApiHelperAsync(_httpClient);

                var token = helper.Get(key);
                if (token != null && token.SecurityToken != null)
                {
                    _internalCache.AddOrUpdate(token.Key, token.SecurityToken.DeserializeSecurityToken(_securityTokenSerializer), token.ExpirationTime);
                    return(true);
                }
            }
            return(false);
        }