Share via


OutputCacheOptions.AddPolicy Method

Definition

Overloads

AddPolicy(String, IOutputCachePolicy)

Defines a IOutputCachePolicy which can be referenced by name.

AddPolicy(String, Action<OutputCachePolicyBuilder>)

Defines a IOutputCachePolicy which can be referenced by name.

AddPolicy(String, Action<OutputCachePolicyBuilder>, Boolean)

Defines a IOutputCachePolicy which can be referenced by name.

AddPolicy(String, IOutputCachePolicy)

Source:
OutputCacheOptions.cs

Defines a IOutputCachePolicy which can be referenced by name.

public void AddPolicy (string name, Microsoft.AspNetCore.OutputCaching.IOutputCachePolicy policy);
member this.AddPolicy : string * Microsoft.AspNetCore.OutputCaching.IOutputCachePolicy -> unit
Public Sub AddPolicy (name As String, policy As IOutputCachePolicy)

Parameters

name
String

The name of the policy.

policy
IOutputCachePolicy

The policy to add

Applies to

AddPolicy(String, Action<OutputCachePolicyBuilder>)

Source:
OutputCacheOptions.cs

Defines a IOutputCachePolicy which can be referenced by name.

public void AddPolicy (string name, Action<Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder> build);
member this.AddPolicy : string * Action<Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder> -> unit
Public Sub AddPolicy (name As String, build As Action(Of OutputCachePolicyBuilder))

Parameters

name
String

The name of the policy.

Remarks

The built policy will be based on the default policy.

Applies to

AddPolicy(String, Action<OutputCachePolicyBuilder>, Boolean)

Source:
OutputCacheOptions.cs

Defines a IOutputCachePolicy which can be referenced by name.

public void AddPolicy (string name, Action<Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder> build, bool excludeDefaultPolicy);
member this.AddPolicy : string * Action<Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder> * bool -> unit
Public Sub AddPolicy (name As String, build As Action(Of OutputCachePolicyBuilder), excludeDefaultPolicy As Boolean)

Parameters

name
String

The name of the policy.

excludeDefaultPolicy
Boolean

Whether to exclude the default policy or not.

Applies to