public DistributedTreeCache(
            IDistributedCache cache,
            IOptions<TreeCacheOptions> optionsAccessor = null)
        {
            if (cache == null) { throw new ArgumentNullException(nameof(cache)); }
            this.cache = cache;

            options = optionsAccessor?.Value;
            if (options == null) options = new TreeCacheOptions(); //default
        }
Esempio n. 2
0
 public DistributedTreeCache(
     IDistributedCache cache,
     ITreeCacheKeyResolver cacheKeyResolver,
     IEnumerable <INavigationTreeBuilder> treeBuilders,
     IOptions <TreeCacheOptions> optionsAccessor = null)
 {
     _cache   = cache ?? throw new ArgumentNullException(nameof(cache));
     _options = optionsAccessor?.Value;
     if (_options == null)
     {
         _options = new TreeCacheOptions();                   //default
     }
     _cacheKeyResolver = cacheKeyResolver;
     _treeBuilders     = treeBuilders;
 }
Esempio n. 3
0
        public MemoryTreeCache(
            IMemoryCache cache,
            IOptions <TreeCacheOptions> optionsAccessor = null)
        {
            if (cache == null)
            {
                throw new ArgumentNullException(nameof(cache));
            }
            this.cache = cache;

            options = optionsAccessor?.Value;
            if (options == null)
            {
                options = new TreeCacheOptions();                  //default
            }
        }