/// <summary> /// Initializes a new instance of the <see cref="T:EasyCaching.Memory.MemoryCachingProvider"/> class. /// </summary> /// <param name="cache">Microsoft MemoryCache.</param> public DefaultInMemoryCachingProvider( IMemoryCache cache, InMemoryOptions options) { this._cache = cache; this._options = options; this._cacheKeys = new ConcurrentCollections.ConcurrentHashSet <string>(); }
/// <summary> /// Initializes a new instance of the <see cref="T:EasyCaching.Memory.MemoryCachingProvider"/> class. /// </summary> /// <param name="cache">Microsoft MemoryCache.</param> public DefaultInMemoryCachingProvider( IMemoryCache cache, InMemoryOptions options, ILoggerFactory loggerFactory = null) { this._cache = cache; this._options = options; this._logger = loggerFactory?.CreateLogger <DefaultInMemoryCachingProvider>(); this._cacheKeys = new ConcurrentCollections.ConcurrentHashSet <string>(); }
/// <summary> /// Initializes a new instance of the <see cref="T:EasyCaching.InMemory.DefaultInMemoryCachingProvider"/> class. /// </summary> /// <param name="cache">Cache.</param> /// <param name="options">Options.</param> /// <param name="loggerFactory">Logger factory.</param> public DefaultInMemoryCachingProvider( IMemoryCache cache, IOptionsMonitor <InMemoryOptions> options, ILoggerFactory loggerFactory = null) { this._cache = cache; this._options = options.CurrentValue; this._logger = loggerFactory?.CreateLogger <DefaultInMemoryCachingProvider>(); this._cacheKeys = new ConcurrentCollections.ConcurrentHashSet <string>(); this._cacheStats = new CacheStats(); //this._name = EasyCachingConstValue.DefaultInMemoryName; }