25 references to CacheVaryBy
Microsoft.AspNetCore.Components (2)
CacheConditionAttribute.cs (2)
18
public CacheConditionAttribute(
CacheVaryBy
varyBy)
27
public
CacheVaryBy
VaryBy { get; }
Microsoft.AspNetCore.Components.Authorization (1)
AuthorizeViewCore.cs (1)
14
[CacheCondition(
CacheVaryBy
.User)]
Microsoft.AspNetCore.Components.Endpoints (21)
CacheView\CacheViewRenderState.cs (2)
8
public CacheViewRenderState(string key,
CacheVaryBy
varyBy)
16
public
CacheVaryBy
VaryBy { get; }
CacheView\CacheViewService.cs (17)
19
private static readonly ConcurrentDictionary<Type, (CacheBehavior? Behavior,
CacheVaryBy
? Condition)> _liveComponentAttributeByType = new();
50
public static bool IsCacheableComponent(Type componentType,
CacheVaryBy
varyBy)
61
var
conditionVaryBy = condition ??
CacheVaryBy
.None;
62
var varyByMatches = conditionVaryBy !=
CacheVaryBy
.None && (conditionVaryBy & varyBy) == conditionVaryBy;
67
$"Component '{componentType.FullName}' cannot be used inside a CacheView because its output depends on per-request state ([CacheBehavior(CacheBehavior.Throw)]{(conditionVaryBy !=
CacheVaryBy
.None ? $", [CacheCondition({FormatVaryByFlags(conditionVaryBy)})]" : "")}) that cannot be safely cached and replayed. " +
68
(conditionVaryBy !=
CacheVaryBy
.None
76
private static string FormatVaryByFlags(
CacheVaryBy
varyBy)
211
public static
CacheVaryBy
GetVaryBy(CacheView cacheView)
213
var
result =
CacheVaryBy
.None;
217
result |=
CacheVaryBy
.Query;
222
result |=
CacheVaryBy
.Route;
227
result |=
CacheVaryBy
.Header;
232
result |=
CacheVaryBy
.Cookie;
237
result |=
CacheVaryBy
.User;
242
result |=
CacheVaryBy
.Culture;
Rendering\CacheViewTextWriter.cs (2)
22
public CacheViewTextWriter(TextWriter inner,
CacheVaryBy
varyBy)
28
public
CacheVaryBy
VaryBy { get; set; }
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
20
[CacheCondition(
CacheVaryBy
.Query)]