共用方式為


OutputCachePolicyBuilder.VaryByValue 方法

定義

多載

VaryByValue(Func<HttpContext,KeyValuePair<String,String>>)

新增原則,以根據自定義索引鍵/值來變更快取的回應。

VaryByValue(Func<HttpContext,CancellationToken,ValueTask<KeyValuePair<String,String>>>)

新增根據指定值而改變快取內容的原則。

VaryByValue(String, String)

新增原則,以根據自定義索引鍵/值來變更快取的回應。

VaryByValue(Func<HttpContext,KeyValuePair<String,String>>)

來源:
OutputCachePolicyBuilder.cs

新增原則,以根據自定義索引鍵/值來變更快取的回應。

public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder VaryByValue (Func<Microsoft.AspNetCore.Http.HttpContext,System.Collections.Generic.KeyValuePair<string,string>> varyBy);
member this.VaryByValue : Func<Microsoft.AspNetCore.Http.HttpContext, System.Collections.Generic.KeyValuePair<string, string>> -> Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder
Public Function VaryByValue (varyBy As Func(Of HttpContext, KeyValuePair(Of String, String))) As OutputCachePolicyBuilder

參數

varyBy
Func<HttpContext,KeyValuePair<String,String>>

要變更快取回應的索引鍵/值。

傳回

適用於

VaryByValue(Func<HttpContext,CancellationToken,ValueTask<KeyValuePair<String,String>>>)

來源:
OutputCachePolicyBuilder.cs

新增根據指定值而改變快取內容的原則。

public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder VaryByValue (Func<Microsoft.AspNetCore.Http.HttpContext,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<System.Collections.Generic.KeyValuePair<string,string>>> varyBy);
member this.VaryByValue : Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<System.Collections.Generic.KeyValuePair<string, string>>> -> Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder
Public Function VaryByValue (varyBy As Func(Of HttpContext, CancellationToken, ValueTask(Of KeyValuePair(Of String, String)))) As OutputCachePolicyBuilder

參數

varyBy
Func<HttpContext,CancellationToken,ValueTask<KeyValuePair<String,String>>>

要變更快取回應的索引鍵/值。

傳回

適用於

VaryByValue(String, String)

來源:
OutputCachePolicyBuilder.cs

新增原則,以根據自定義索引鍵/值來變更快取的回應。

public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder VaryByValue (string key, string value);
member this.VaryByValue : string * string -> Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder
Public Function VaryByValue (key As String, value As String) As OutputCachePolicyBuilder

參數

key
String

要變更快取回應的索引鍵。

value
String

要變更快取回應的值。

傳回

適用於