1 type derived from MemoryCache
Microsoft.Extensions.Caching.Hybrid.Tests (1)
ServiceConstructionTests.cs (1)
198class CustomMemoryCache : MemoryCache
58 instantiations of MemoryCache
CookieSessionSample (1)
MemoryCacheTicketStore.cs (1)
17_cache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateValidationCache.cs (1)
24_cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = _options.CacheSize, Clock = new CachingClock(timeProvider) });
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\LdapAdapter.cs (1)
28settings.ClaimsCache = new MemoryCache(new MemoryCacheOptions { SizeLimit = settings.ClaimsCacheSize });
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
210var claimsCache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitRegistry.cs (1)
56DisconnectedCircuits = new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.Mvc.Razor (3)
Infrastructure\TagHelperMemoryCacheProvider.cs (1)
18public IMemoryCache Cache { get; internal set; } = new MemoryCache(new MemoryCacheOptions
RazorViewEngine.cs (2)
78ViewLookupCache = new MemoryCache(new MemoryCacheOptions()); 83ViewLookupCache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompiler.cs (1)
57_cache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.Mvc.TagHelpers (1)
CacheTagHelperMemoryCacheFactory.cs (1)
21Cache = new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.Mvc.TagHelpers.Test (24)
CacheTagHelperTest.cs (16)
68var cache = new MemoryCache(new MemoryCacheOptions()); 95var cache = new MemoryCache(new MemoryCacheOptions()); 146var cache = new MemoryCache(new MemoryCacheOptions()); 195var cache = new MemoryCache(new MemoryCacheOptions()); 258var cache = new MemoryCache(new MemoryCacheOptions()); 273var cache = new MemoryCache(new MemoryCacheOptions()); 291var cache = new MemoryCache(new MemoryCacheOptions()); 309var cache = new MemoryCache(new MemoryCacheOptions()); 332var cache = new MemoryCache(new MemoryCacheOptions { Clock = clock.Object }); 385var cache = new MemoryCache(new MemoryCacheOptions { Clock = clock.Object }); 438var cache = new MemoryCache(new MemoryCacheOptions { Clock = clock.Object }); 489var cache = new MemoryCache(new MemoryCacheOptions() { TrackLinkedCacheEntries = true }); 547var cache = new MemoryCache(new MemoryCacheOptions()); 632var cache = new MemoryCache(new MemoryCacheOptions()); 711var cache = new MemoryCache(new MemoryCacheOptions()); 803var cache = new MemoryCache(new MemoryCacheOptions());
DefaultTagHelperActivatorTest.cs (1)
22private readonly IMemoryCache MemoryCache = new MemoryCache(new MemoryCacheOptions());
GlobbingUrlBuilderTest.cs (7)
21var cache = new MemoryCache(new MemoryCacheOptions()); 37var cache = new MemoryCache(new MemoryCacheOptions()); 209var cache = new MemoryCache(new MemoryCacheOptions()); 229var cache = new MemoryCache(new MemoryCacheOptions()); 339var cache = new MemoryCache(new MemoryCacheOptions()); 363var cache = new MemoryCache(new MemoryCacheOptions()); 391var cache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheServiceCollectionExtensions.cs (1)
34return new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.OutputCaching.Tests (11)
MemoryOutputCacheStoreTests.cs (10)
14var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions())); 29var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock })); 44var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions())); 54var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions())); 65var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock })); 93var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock })); 113var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock })); 129var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock })); 159var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 1000, Clock = testClock, ExpirationScanFrequency = TimeSpan.FromMilliseconds(1) }); 204var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions()));
OutputCacheMiddlewareTests.cs (1)
764cache: new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
49new MemoryResponseCache(new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.ResponseCaching.Tests (1)
ResponseCachingMiddlewareTests.cs (1)
851cache: new MemoryResponseCache(new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.Session.Tests (9)
SessionTests.cs (9)
664services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 713services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 762services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 810services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 862services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 925services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 991services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 1056services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 1108services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions()))
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
38_memCache = new MemoryCache(optionsAccessor.Value, loggerFactory);
46 references to MemoryCache
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateValidationCache.cs (1)
17private readonly MemoryCache _cache;
Microsoft.AspNetCore.Authentication.Negotiate (1)
LdapSettings.cs (1)
76internal MemoryCache? ClaimsCache { get; set; }
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
210var claimsCache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitRegistry.cs (1)
69internal MemoryCache DisconnectedCircuits { get; }
Microsoft.AspNetCore.Mvc.Razor (1)
DependencyInjection\MvcRazorMvcCoreBuilderExtensions.cs (1)
151services.TryAddSingleton<IMemoryCache, MemoryCache>();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (23)
CacheTagHelperTest.cs (16)
68var cache = new MemoryCache(new MemoryCacheOptions()); 95var cache = new MemoryCache(new MemoryCacheOptions()); 146var cache = new MemoryCache(new MemoryCacheOptions()); 195var cache = new MemoryCache(new MemoryCacheOptions()); 258var cache = new MemoryCache(new MemoryCacheOptions()); 273var cache = new MemoryCache(new MemoryCacheOptions()); 291var cache = new MemoryCache(new MemoryCacheOptions()); 309var cache = new MemoryCache(new MemoryCacheOptions()); 332var cache = new MemoryCache(new MemoryCacheOptions { Clock = clock.Object }); 385var cache = new MemoryCache(new MemoryCacheOptions { Clock = clock.Object }); 438var cache = new MemoryCache(new MemoryCacheOptions { Clock = clock.Object }); 489var cache = new MemoryCache(new MemoryCacheOptions() { TrackLinkedCacheEntries = true }); 547var cache = new MemoryCache(new MemoryCacheOptions()); 632var cache = new MemoryCache(new MemoryCacheOptions()); 711var cache = new MemoryCache(new MemoryCacheOptions()); 803var cache = new MemoryCache(new MemoryCacheOptions());
GlobbingUrlBuilderTest.cs (7)
21var cache = new MemoryCache(new MemoryCacheOptions()); 37var cache = new MemoryCache(new MemoryCacheOptions()); 209var cache = new MemoryCache(new MemoryCacheOptions()); 229var cache = new MemoryCache(new MemoryCacheOptions()); 339var cache = new MemoryCache(new MemoryCacheOptions()); 363var cache = new MemoryCache(new MemoryCacheOptions()); 391var cache = new MemoryCache(new MemoryCacheOptions());
Microsoft.AspNetCore.OutputCaching (2)
Memory\MemoryOutputCacheStore.cs (2)
11private readonly MemoryCache _cache; 15internal MemoryOutputCacheStore(MemoryCache cache)
Microsoft.AspNetCore.OutputCaching.Tests (1)
MemoryOutputCacheStoreTests.cs (1)
159var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 1000, Clock = testClock, ExpirationScanFrequency = TimeSpan.FromMilliseconds(1) });
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.cs (1)
68&& _localCache.GetType() == typeof(MemoryCache))
Microsoft.Extensions.Caching.Memory (14)
CacheEntry.cs (2)
20private readonly MemoryCache _cache; 38internal CacheEntry(object key, MemoryCache memoryCache)
MemoryCache.cs (9)
35/// Creates a new <see cref="MemoryCache"/> instance. 42/// Creates a new <see cref="MemoryCache"/> instance. 52_logger = loggerFactory.CreateLogger<MemoryCache>(); 80/// Gets an enumerable of the all the keys in the <see cref="MemoryCache"/>. 356Task.Factory.StartNew(state => ((MemoryCache)state!).ScanForExpiredItems(), this, 385private readonly MemoryCache? _memoryCache; 391public Stats(MemoryCache memoryCache) 483ThreadPool.QueueUserWorkItem(s => ((MemoryCache)s!).OvercapacityCompaction(), this); 636static void Throw() => throw new ObjectDisposedException(typeof(MemoryCache).FullName);
MemoryCacheOptions.cs (1)
12/// Options class for <see cref="MemoryCache"/>.
MemoryCacheServiceCollectionExtensions.cs (1)
27services.TryAdd(ServiceDescriptor.Singleton<IMemoryCache, MemoryCache>());
MemoryDistributedCache.cs (1)
19private readonly MemoryCache _memCache;