OutputCacheOptions.AddPolicy 方法

定义

重载

AddPolicy(String, IOutputCachePolicy)

定义可以按名称引用的 IOutputCachePolicy

AddPolicy(String, Action<OutputCachePolicyBuilder>)

定义可以按名称引用的 IOutputCachePolicy

AddPolicy(String, Action<OutputCachePolicyBuilder>, Boolean)

定义可以按名称引用的 IOutputCachePolicy

AddPolicy(String, IOutputCachePolicy)

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

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

Source:
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

是否排除默认策略。

适用于