33 references to HybridCacheEntryFlags
Microsoft.Extensions.Caching.Abstractions (1)
Hybrid\HybridCacheEntryOptions.cs (1)
31public HybridCacheEntryFlags? Flags { get; init; }
Microsoft.Extensions.Caching.Hybrid (25)
Internal\DefaultHybridCache.cs (12)
39private readonly HybridCacheEntryFlags _hardFlags; // *always* present (for example, because no L2) 40private readonly HybridCacheEntryFlags _defaultFlags; // note this already includes hardFlags 103_hardFlags |= HybridCacheEntryFlags.DisableDistributedCache; 106_defaultFlags = (defaultEntryOptions?.Flags ?? HybridCacheEntryFlags.None) | _hardFlags; 126var flags = GetEffectiveFlags(options); 134if ((flags & HybridCacheEntryFlags.DisableLocalCacheRead) == 0) 197var flags = GetEffectiveFlags(options) | (HybridCacheEntryFlags.DisableLocalCacheRead | HybridCacheEntryFlags.DisableDistributedCacheRead); 202private static ValueTask<T> RunWithoutCacheAsync<TState, T>(HybridCacheEntryFlags flags, TState state, 206return (flags & HybridCacheEntryFlags.DisableUnderlyingData) == 0 211private HybridCacheEntryFlags GetEffectiveFlags(HybridCacheEntryOptions? options)
Internal\DefaultHybridCache.Stampede.cs (3)
16public bool GetOrCreateStampedeState<TState, T>(string key, HybridCacheEntryFlags flags, out StampedeState<TState, T> stampedeState, bool canBeCanceled) 59if ((flags & HybridCacheEntryFlags.DisableLocalCache) == 0 && _localCache.TryGetValue(key, out var untyped) 106internal int DebugGetCallerCount(string key, HybridCacheEntryFlags? flags = null)
Internal\DefaultHybridCache.StampedeKey.cs (3)
15private readonly HybridCacheEntryFlags _flags; 17public StampedeKey(string key, HybridCacheEntryFlags flags) 37public HybridCacheEntryFlags Flags => _flags;
Internal\DefaultHybridCache.StampedeStateT.cs (7)
19private const HybridCacheEntryFlags FlagsDisableL1AndL2Write = HybridCacheEntryFlags.DisableLocalCacheWrite | HybridCacheEntryFlags.DisableDistributedCacheWrite; 170if ((Key.Flags & HybridCacheEntryFlags.DisableDistributedCacheRead) == 0) 221if ((Key.Flags & HybridCacheEntryFlags.DisableUnderlyingData) == 0) 300if ((Key.Flags & HybridCacheEntryFlags.DisableDistributedCacheWrite) == 0) 463if ((Key.Flags & HybridCacheEntryFlags.DisableLocalCacheWrite) == 0)
Microsoft.Extensions.Caching.Hybrid.Tests (7)
BufferReleaseTests.cs (1)
76private static readonly HybridCacheEntryOptions _noUnderlying = new() { Flags = HybridCacheEntryFlags.DisableUnderlyingData };
L2Tests.cs (1)
24private static readonly HybridCacheEntryOptions _expiryNoL1 = new() { Flags = HybridCacheEntryFlags.DisableLocalCache, Expiration = TimeSpan.FromMinutes(3.5) };
ServiceConstructionTests.cs (2)
41options.DefaultEntryOptions = new() { Expiration = TimeSpan.FromSeconds(120), Flags = HybridCacheEntryFlags.DisableLocalCacheRead }; 50Assert.Equal(HybridCacheEntryFlags.DisableLocalCacheRead, defaults.Flags);
StampedeTests.cs (2)
24Flags = HybridCacheEntryFlags.DisableDistributedCache | HybridCacheEntryFlags.DisableLocalCache
UnreliableL2Tests.cs (1)
109private static HybridCacheEntryOptions NoL2Write { get; } = new HybridCacheEntryOptions { Flags = HybridCacheEntryFlags.DisableDistributedCacheWrite };