public InMemoryObjectCacheFactory( IOptions <MemoryCacheOptions> optionsAccessor, InMemoryObjectCacheSettings inMemoryObjectCacheSettings ) { _memoryCache = new ClearableMemoryCache(optionsAccessor); _inMemoryObjectCacheSettings = inMemoryObjectCacheSettings; }
/// <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 InMemoryObjectCache(ClearableMemoryCache cache, string cacheNamespace) { if (cache == null) { throw new ArgumentNullException(nameof(cache)); } _cache = cache; _cacheNamespace = cacheNamespace ?? string.Empty; }
public InMemoryObjectCacheFactory( IOptions <MemoryCacheOptions> optionsAccessor ) { _memoryCache = new ClearableMemoryCache(optionsAccessor); }