OutputCacheOptions.AddPolicy Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
- build
- Action<OutputCachePolicyBuilder>
An action on OutputCachePolicyBuilder.
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.
- build
- Action<OutputCachePolicyBuilder>
An action on OutputCachePolicyBuilder.
- excludeDefaultPolicy
- Boolean
Whether to exclude the default policy or not.