1 write to _options
Microsoft.Extensions.Caching.Memory (1)
MemoryCache.cs (1)
51_options = optionsAccessor.Value;
19 references to _options
Microsoft.Extensions.Caching.Memory (19)
MemoryCache.cs (19)
56if (_options.TrackStatistics) 64TrackLinkedCacheEntries = _options.TrackLinkedCacheEntries; // we store the setting now so it's consistent for entire MemoryCache lifetime 67private DateTime UtcNow => _options.Clock?.UtcNow.UtcDateTime ?? DateTime.UtcNow; 120if (_options.HasSizeLimit && entry.Size < 0) 122throw new InvalidOperationException(SR.Format(SR.CacheEntryHasEmptySize, nameof(entry.Size), nameof(_options.SizeLimit))); 153coherentState.RemoveEntry(priorEntry, _options); 171if (_options.HasSizeLimit) 192if (_options.HasSizeLimit) 210coherentState.RemoveEntry(priorEntry, _options); 259coherentState.RemoveEntry(entry, _options); 288if (_options.HasSizeLimit) 329CurrentEstimatedSize = _options.SizeLimit.HasValue ? Size : null 339_coherentState.RemoveEntry(entry, _options); 348if (_options.ExpirationScanFrequency < utcNow - _lastExpirationScan) 438coherentState.RemoveEntry(entry, _options); 449long sizeLimit = _options.SizeLimitValue; 494long sizeLimit = _options.SizeLimitValue; 497long lowWatermark = sizeLimit - (long)(sizeLimit * _options.CompactionPercentage); 568coherentState.RemoveEntry(entry, _options);