IDistributedCache.SetAsync Metodo

Definizione

Overload

SetAsync(String, Byte[], DistributedCacheEntryOptions)
SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken)

Imposta il valore con la chiave specificata.

SetAsync(String, Byte[], DistributedCacheEntryOptions)

public:
 System::Threading::Tasks::Task ^ SetAsync(System::String ^ key, cli::array <System::Byte> ^ value, Microsoft::Extensions::Caching::Distributed::DistributedCacheEntryOptions ^ options);
public System.Threading.Tasks.Task SetAsync (string key, byte[] value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options);
abstract member SetAsync : string * byte[] * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions -> System.Threading.Tasks.Task
Public Function SetAsync (key As String, value As Byte(), options As DistributedCacheEntryOptions) As Task

Parametri

key
String
value
Byte[]

Restituisce

Commenti

Questo metodo archivia nell'attività che restituisce tutte le eccezioni non di utilizzo che la controparte sincrona del metodo può generare. Se un'eccezione viene archiviata nell'attività restituita, tale eccezione verrà generata quando l'attività è attesa. Le eccezioni di utilizzo, ad esempio ArgumentException, vengono comunque generate in modo sincrono. Per le eccezioni archiviate, vedere le eccezioni generate da Set(String, Byte[], DistributedCacheEntryOptions).

Si applica a

SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken)

Origine:
IDistributedCache.cs
Origine:
IDistributedCache.cs
Origine:
IDistributedCache.cs
Origine:
IDistributedCache.cs

Imposta il valore con la chiave specificata.

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

Parametri

key
String

Stringa che identifica il valore richiesto.

value
Byte[]

Valore da impostare nella cache.

options
DistributedCacheEntryOptions

Opzioni della cache per il valore.

token
CancellationToken

facoltativo. Oggetto CancellationToken usato per propagare le notifiche di richiesta di annullamento dell'operazione.

Restituisce

Oggetto Task che rappresenta l'operazione asincrona.

Eccezioni

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Commenti

Questo metodo archivia nell'attività che restituisce tutte le eccezioni non di utilizzo che la controparte sincrona del metodo può generare. Se un'eccezione viene archiviata nell'attività restituita, tale eccezione verrà generata quando l'attività è attesa. Le eccezioni di utilizzo, ad esempio ArgumentException, vengono comunque generate in modo sincrono. Per le eccezioni archiviate, vedere le eccezioni generate da Set(String, Byte[], DistributedCacheEntryOptions).

Si applica a