Esempio n. 1
0
        /// return the cache based on:
        /// 1) a cache exists with the Principal.CacheName
        /// 2) default.
        private ICache GetCacheFromConfig()
        {
            var cacheName = _cacheContext.Principal?.CacheName;

            if (!String.IsNullOrWhiteSpace(cacheName) && _cacheContext.Exist(cacheName))
            {
                _logger.Technical().From <CacheHelper>().System($"The Owin token cache is {cacheName}.").Log();
                return(_cacheContext[cacheName]);
            }

            return(_cacheContext.Default);
        }