public SqlDistributedObjectCacheFactory( IOptions <SqlServerCacheOptions> optionsAccessor, IDistributedCache cache ) { _cache = cache; _sqlCache = new ClearableSqlDistributedCache(_cache); }
/// <summary> /// Creates a new instance of an InMemoryObjectCache object. /// </summary> /// <param name="cache">The parent MemoryCache instance to use.</param> /// <param name="cacheNamespace">Unique cache namespace to organise all cache items under.</param> public SqlDistributedObjectCache(ClearableSqlDistributedCache cache, string cacheNamespace) { if (cache == null) { throw new ArgumentNullException(nameof(cache)); } _cache = cache; _cacheNamespace = cacheNamespace ?? string.Empty; }