共用方式為


OutputCacheOptions.AddPolicy 方法

定義

多載

AddPolicy(String, IOutputCachePolicy)

定義可依名稱參考的 IOutputCachePolicy

AddPolicy(String, Action<OutputCachePolicyBuilder>)

定義可依名稱參考的 IOutputCachePolicy

AddPolicy(String, Action<OutputCachePolicyBuilder>, Boolean)

定義可依名稱參考的 IOutputCachePolicy

AddPolicy(String, IOutputCachePolicy)

來源:
OutputCacheOptions.cs

定義可依名稱參考的 IOutputCachePolicy

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)

參數

name
String

原則的名稱。

policy
IOutputCachePolicy

要新增的原則

適用於

AddPolicy(String, Action<OutputCachePolicyBuilder>)

來源:
OutputCacheOptions.cs

定義可依名稱參考的 IOutputCachePolicy

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))

參數

name
String

原則的名稱。

備註

建置的原則會以預設原則為基礎。

適用於

AddPolicy(String, Action<OutputCachePolicyBuilder>, Boolean)

來源:
OutputCacheOptions.cs

定義可依名稱參考的 IOutputCachePolicy

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)

參數

name
String

原則的名稱。

excludeDefaultPolicy
Boolean

是否要排除默認原則。

適用於