Sdílet prostřednictvím


IBufferDistributedCache.SetAsync Metoda

Definice

Asynchronně nastaví nebo přepíše položku mezipaměti.

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

Parametry

key
String

Klíč položky, která se má vytvořit.

value
ReadOnlySequence<Byte>

Hodnota pro tuto položku mezipaměti.

options
DistributedCacheEntryOptions

Možnosti mezipaměti pro hodnotu.

token
CancellationToken

CancellationToken sloužící k šíření oznámení, že by měla být operace zrušena.

Návraty

Poznámky

Toto je funkčně podobné SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken), ale zabraňuje přidělení pole.

Platí pro