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