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 }
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; }
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 } }