1 type derived from MemoryCache
Microsoft.Extensions.Caching.Hybrid.Tests (1)
ServiceConstructionTests.cs (1)
622private class CustomMemoryCache : MemoryCache
12 instantiations of MemoryCache
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitRegistry.cs (1)
59DisconnectedCircuits = new MemoryCache(new MemoryCacheOptions
Circuits\DefaultInMemoryCircuitPersistenceProvider.cs (1)
30_persistedCircuits = new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.HeaderParsing (1)
HeaderKey.cs (1)
44_valueCache = new MemoryCache(Options.Create(o));
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.TagHelpers (1)
CacheTagHelperMemoryCacheFactory.cs (1)
21Cache = new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheServiceCollectionExtensions.cs (1)
35return new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
49new MemoryResponseCache(new MemoryCache(new MemoryCacheOptions
Microsoft.Extensions.Caching.Hybrid.Tests (2)
ExpirationTests.cs (1)
22using var l1 = new MemoryCache(new MemoryCacheOptions { Clock = clock });
LocalInvalidationTests.cs (1)
54using IMemoryCache l1 = new MemoryCache(new MemoryCacheOptions());
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
38_memCache = new MemoryCache(optionsAccessor.Value, loggerFactory);
33 references to MemoryCache
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitRegistry.cs (1)
72internal MemoryCache DisconnectedCircuits { get; }
Circuits\DefaultInMemoryCircuitPersistenceProvider.cs (1)
18private readonly MemoryCache _persistedCircuits;
Microsoft.AspNetCore.Mvc.Razor (1)
DependencyInjection\MvcRazorMvcCoreBuilderExtensions.cs (1)
151services.TryAddSingleton<IMemoryCache, MemoryCache>();
Microsoft.AspNetCore.OutputCaching (2)
Memory\MemoryOutputCacheStore.cs (2)
12private readonly MemoryCache _cache; 16internal MemoryOutputCacheStore(MemoryCache cache)
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.cs (1)
90&& _localCache.GetType() == typeof(MemoryCache))
Microsoft.Extensions.Caching.Hybrid.Tests (5)
ExpirationTests.cs (1)
22using var l1 = new MemoryCache(new MemoryCacheOptions { Clock = clock });
UnreliableL2Tests.cs (4)
25using (GetServices(out var hc, out var l1, out var l2, out var log)) 62using (GetServices(out var hc, out var l1, out var l2, out var log)) 123private static IDisposable GetServices(out HybridCache hc, out MemoryCache l1, 146l1 = Assert.IsType<MemoryCache>(lifetime.GetRequiredService<IMemoryCache>());
Microsoft.Extensions.Caching.Memory (22)
CacheEntry.cs (2)
20private readonly MemoryCache _cache; 38internal CacheEntry(object key, MemoryCache memoryCache)
MemoryCache.cs (17)
41/// Creates a new <see cref="MemoryCache"/> instance. 48/// Creates a new <see cref="MemoryCache"/> instance. 56/// Creates a new <see cref="MemoryCache"/> instance. 66_logger = (loggerFactory ?? NullLoggerFactory.Instance).CreateLogger<MemoryCache>(); 99/// Gets an enumerable of the all the keys in the <see cref="MemoryCache"/>. 421Task.Factory.StartNew(state => ((MemoryCache)state!).ScanForExpiredItems(), this, 447public StatsHandler(MemoryCache memoryCache) 460private readonly MemoryCache _memoryCache; 465public Stats(MemoryCache memoryCache) 579((MemoryCache)s!).OvercapacityCompaction(); 583((MemoryCache)s!).lockFlag = 0; // Release the lock 746static void Throw() => throw new ObjectDisposedException(typeof(MemoryCache).FullName); 885WeakReference<MemoryCache> weakThis = new(this); 891if (!weakThis.TryGetTarget(out MemoryCache? cache) || cache._disposed) 911if (!weakThis.TryGetTarget(out MemoryCache? cache) || cache._disposed) 927if (!weakThis.TryGetTarget(out MemoryCache? cache) || cache._disposed) 943if (!weakThis.TryGetTarget(out MemoryCache? cache) || cache._disposed)
MemoryCacheOptions.cs (1)
12/// Specifies options for <see cref="MemoryCache"/>.
MemoryCacheServiceCollectionExtensions.cs (1)
27services.TryAdd(ServiceDescriptor.Singleton<IMemoryCache, MemoryCache>());
MemoryDistributedCache.cs (1)
19private readonly MemoryCache _memCache;