1 write to _options
Microsoft.Extensions.Caching.Memory (1)
21 references to _options
Microsoft.Extensions.Caching.Memory (21)
MemoryCache.cs (21)
70if (_options.TrackStatistics)
77Tags = [new("dotnet.cache.name", _options.Name)]
83TrackLinkedCacheEntries = _options.TrackLinkedCacheEntries; // we store the setting now so it's consistent for entire MemoryCache lifetime
86private DateTime UtcNow => _options.Clock?.UtcNow.UtcDateTime ?? DateTime.UtcNow;
136if (_options.HasSizeLimit && entry.Size < 0)
138throw new InvalidOperationException(SR.Format(SR.CacheEntryHasEmptySize, nameof(entry.Size), nameof(_options.SizeLimit)));
169coherentState.RemoveEntry(priorEntry, _options);
187if (_options.HasSizeLimit)
214if (_options.HasSizeLimit)
232coherentState.RemoveEntry(priorEntry, _options);
334if (coherentState.RemoveEntry(entry, _options) && _allStats is not null)
367if (_options.HasSizeLimit)
408CurrentEstimatedSize = _options.HasSizeLimit ? Size : null,
419if (_coherentState.RemoveEntry(entry, _options) && _allStats is not null)
432if (_options.ExpirationScanFrequency < utcNow - _lastExpirationScan)
532if (coherentState.RemoveEntry(entry, _options) && _allStats is not null)
550long sizeLimit = _options.SizeLimitValue;
619long sizeLimit = _options.SizeLimitValue;
622long lowWatermark = sizeLimit - (long)(sizeLimit * _options.CompactionPercentage);
693if (coherentState.RemoveEntry(entry, _options))
923KeyValuePair<string, object?> cacheNameTag = new("dotnet.cache.name", _options.Name);