public InMemoryObjectCacheFactory(
     IOptions <MemoryCacheOptions> optionsAccessor,
     InMemoryObjectCacheSettings inMemoryObjectCacheSettings
     )
 {
     _memoryCache = new ClearableMemoryCache(optionsAccessor);
     _inMemoryObjectCacheSettings = inMemoryObjectCacheSettings;
 }
Пример #2
0
        /// <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;
        }
Пример #3
0
 public InMemoryObjectCacheFactory(
     IOptions <MemoryCacheOptions> optionsAccessor
     )
 {
     _memoryCache = new ClearableMemoryCache(optionsAccessor);
 }