DistributedCacheExtensions.SetStringAsync Metodo

Definizione

Overload

SetStringAsync(IDistributedCache, String, String)

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions)

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

SetStringAsync(IDistributedCache, String, String, CancellationToken)

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions, CancellationToken)

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

SetStringAsync(IDistributedCache, String, String)

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ SetStringAsync(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, System::String ^ value);
public static System.Threading.Tasks.Task SetStringAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value);
static member SetStringAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string -> System.Threading.Tasks.Task
<Extension()>
Public Function SetStringAsync (cache As IDistributedCache, key As String, value As String) As Task

Parametri

cache
IDistributedCache

Cache in cui archiviare i dati.

key
String

Chiave in cui archiviare i dati.

value
String

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 SetString(IDistributedCache, String, String).

Si applica a

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions)

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ SetStringAsync(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, System::String ^ value, Microsoft::Extensions::Caching::Distributed::DistributedCacheEntryOptions ^ options);
public static System.Threading.Tasks.Task SetStringAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options);
static member SetStringAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions -> System.Threading.Tasks.Task
<Extension()>
Public Function SetStringAsync (cache As IDistributedCache, key As String, value As String, options As DistributedCacheEntryOptions) As Task

Parametri

cache
IDistributedCache

Cache in cui archiviare i dati.

key
String

Chiave in cui archiviare i dati.

value
String

Dati da archiviare nella cache.

options
DistributedCacheEntryOptions

Opzioni della cache per la voce.

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 SetString(IDistributedCache, String, String, DistributedCacheEntryOptions).

Si applica a

SetStringAsync(IDistributedCache, String, String, CancellationToken)

Origine:
DistributedCacheExtensions.cs
Origine:
DistributedCacheExtensions.cs
Origine:
DistributedCacheExtensions.cs

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

public static System.Threading.Tasks.Task SetStringAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, System.Threading.CancellationToken token = default);
static member SetStringAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SetStringAsync (cache As IDistributedCache, key As String, value As String, 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
String

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 SetString(IDistributedCache, String, String).

Si applica a

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions, CancellationToken)

Origine:
DistributedCacheExtensions.cs
Origine:
DistributedCacheExtensions.cs
Origine:
DistributedCacheExtensions.cs

Imposta in modo asincrono una stringa nella cache specificata con la chiave specificata.

public static System.Threading.Tasks.Task SetStringAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.Threading.CancellationToken token = default);
static member SetStringAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SetStringAsync (cache As IDistributedCache, key As String, value As String, options As DistributedCacheEntryOptions, 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
String

Dati da archiviare nella cache.

options
DistributedCacheEntryOptions

Opzioni della cache per la voce.

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 SetString(IDistributedCache, String, String, DistributedCacheEntryOptions).

Si applica a