共用方式為


IBufferDistributedCache.SetAsync 方法

定義

以異步方式設定或覆寫快取專案。

public System.Threading.Tasks.ValueTask SetAsync (string key, System.Buffers.ReadOnlySequence<byte> value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.Threading.CancellationToken token = default);
abstract member SetAsync : string * System.Buffers.ReadOnlySequence<byte> * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Function SetAsync (key As String, value As ReadOnlySequence(Of Byte), options As DistributedCacheEntryOptions, Optional token As CancellationToken = Nothing) As ValueTask

參數

key
String

要建立之專案的索引鍵。

value
ReadOnlySequence<Byte>

這個快取專案的值。

options
DistributedCacheEntryOptions

值的快取選項。

token
CancellationToken

用來傳播作業應取消之通知的 CancellationToken

傳回

備註

這在功能上與 SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken)類似,但會避免數位配置。

適用於