DistributedCacheExtensions.SetAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
SetAsync(IDistributedCache, String, Byte[]) |
Imposta in modo asincrono una sequenza di byte nella cache specificata con la chiave specificata. |
SetAsync(IDistributedCache, String, Byte[], CancellationToken) |
Imposta in modo asincrono una sequenza di byte nella cache specificata con la chiave specificata. |
SetAsync(IDistributedCache, String, Byte[])
Imposta in modo asincrono una sequenza di byte nella cache specificata con la chiave specificata.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task ^ SetAsync(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, cli::array <System::Byte> ^ value);
public static System.Threading.Tasks.Task SetAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value);
static member SetAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * byte[] -> System.Threading.Tasks.Task
<Extension()>
Public Function SetAsync (cache As IDistributedCache, key As String, value As Byte()) As Task
Parametri
- cache
- IDistributedCache
Cache in cui archiviare i dati.
- key
- String
Chiave in cui archiviare i dati.
- value
- Byte[]
Dati da archiviare nella cache.
Restituisce
Attività che rappresenta l'operazione set asincrona.
Eccezioni
key
o value
è null.
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(IDistributedCache, String, Byte[]).
Si applica a
SetAsync(IDistributedCache, String, Byte[], CancellationToken)
Imposta in modo asincrono una sequenza di byte nella cache specificata con la chiave specificata.
public static System.Threading.Tasks.Task SetAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value, System.Threading.CancellationToken token = default);
static member SetAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SetAsync (cache As IDistributedCache, key As String, value As Byte(), Optional token As CancellationToken = Nothing) As Task
Parametri
- cache
- IDistributedCache
Cache in cui archiviare i dati.
- key
- String
Chiave in cui archiviare i dati.
- value
- Byte[]
Dati da archiviare nella cache.
- token
- CancellationToken
facoltativo. Oggetto CancellationToken per annullare l'operazione.
Restituisce
Attività che rappresenta l'operazione set asincrona.
Eccezioni
key
o value
è null.
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(IDistributedCache, String, Byte[]).
Si applica a
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: nel corso del 2024 verranno dismessi i problemi di GitHub come meccanismo di feedback per il contenuto e verranno sostituiti con un nuovo sistema di feedback. Per altre informazioni, vedere:Invia e visualizza il feedback per