OutputCachePolicyBuilder.With Method

Definition

Overloads

With(Func<OutputCacheContext,Boolean>)

Adds a requirement to the current policy.

With(Func<OutputCacheContext,CancellationToken,ValueTask<Boolean>>)

Adds a requirement to the current policy.

With(Func<OutputCacheContext,Boolean>)

Source:
OutputCachePolicyBuilder.cs

Adds a requirement to the current policy.

C#
public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder With (Func<Microsoft.AspNetCore.OutputCaching.OutputCacheContext,bool> predicate);

Parameters

predicate
Func<OutputCacheContext,Boolean>

The predicate applied to the policy.

Returns

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 7.0, 8.0, 9.0

With(Func<OutputCacheContext,CancellationToken,ValueTask<Boolean>>)

Source:
OutputCachePolicyBuilder.cs

Adds a requirement to the current policy.

C#
public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder With (Func<Microsoft.AspNetCore.OutputCaching.OutputCacheContext,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<bool>> predicate);

Parameters

predicate
Func<OutputCacheContext,CancellationToken,ValueTask<Boolean>>

The predicate applied to the policy.

Returns

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 7.0, 8.0, 9.0