Condividi tramite


IBufferDistributedCache.SetAsync Metodo

Definizione

Imposta o sovrascrive in modo asincrono una voce della cache.

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

Parametri

key
String

Chiave della voce da creare.

value
ReadOnlySequence<Byte>

Valore per questa voce della cache.

options
DistributedCacheEntryOptions

Opzioni della cache per il valore.

token
CancellationToken

Il CancellationToken utilizzato per propagare le notifiche che l'operazione deve essere annullata.

Restituisce

Commenti

Questa operazione è funzionalmente simile a SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken), ma evita l'allocazione di matrici.

Si applica a