DistributedCacheExtensions.SetStringAsync Méthode

Définition

Surcharges

SetStringAsync(IDistributedCache, String, String)

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions)

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

SetStringAsync(IDistributedCache, String, String, CancellationToken)

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

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

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

SetStringAsync(IDistributedCache, String, String)

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

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

Paramètres

cache
IDistributedCache

Cache dans lequel stocker les données.

key
String

Clé dans laquelle stocker les données.

value
String

Données à stocker dans le cache.

Retours

Tâche qui représente l’opération de définition asynchrone.

Exceptions

key ou value est null.

Remarques

Cette méthode stocke dans la tâche toutes les exceptions de non-utilisation que l’équivalent synchrone de la méthode peut lever. Si une exception est stockée dans la tâche retournée, cette exception sera levée lorsque la tâche est attendue. Les exceptions d’utilisation, telles que ArgumentException, sont toujours levées de manière synchrone. Pour connaître les exceptions stockées, consultez les exceptions levées par SetString(IDistributedCache, String, String).

S’applique à

SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions)

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

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

Paramètres

cache
IDistributedCache

Cache dans lequel stocker les données.

key
String

Clé dans laquelle stocker les données.

value
String

Données à stocker dans le cache.

options
DistributedCacheEntryOptions

Options de cache de l’entrée.

Retours

Tâche qui représente l’opération de définition asynchrone.

Exceptions

key ou value est null.

Remarques

Cette méthode stocke dans la tâche toutes les exceptions de non-utilisation que l’équivalent synchrone de la méthode peut lever. Si une exception est stockée dans la tâche retournée, cette exception sera levée lorsque la tâche est attendue. Les exceptions d’utilisation, telles que ArgumentException, sont toujours levées de manière synchrone. Pour connaître les exceptions stockées, consultez les exceptions levées par SetString(IDistributedCache, String, String, DistributedCacheEntryOptions).

S’applique à

SetStringAsync(IDistributedCache, String, String, CancellationToken)

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

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

Paramètres

cache
IDistributedCache

Cache dans lequel stocker les données.

key
String

Clé dans laquelle stocker les données.

value
String

Données à stocker dans le cache.

token
CancellationToken

Optionnel. CancellationToken permettant d’annuler l’opération.

Retours

Tâche qui représente l’opération de définition asynchrone.

Exceptions

key ou value est null.

Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.

Remarques

Cette méthode stocke dans la tâche toutes les exceptions de non-utilisation que l’équivalent synchrone de la méthode peut lever. Si une exception est stockée dans la tâche retournée, cette exception sera levée lorsque la tâche est attendue. Les exceptions d’utilisation, telles que ArgumentException, sont toujours levées de manière synchrone. Pour connaître les exceptions stockées, consultez les exceptions levées par SetString(IDistributedCache, String, String).

S’applique à

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

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

Définit de manière asynchrone une chaîne dans le cache spécifié avec la clé spécifiée.

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

Paramètres

cache
IDistributedCache

Cache dans lequel stocker les données.

key
String

Clé dans laquelle stocker les données.

value
String

Données à stocker dans le cache.

options
DistributedCacheEntryOptions

Options de cache de l’entrée.

token
CancellationToken

Optionnel. CancellationToken permettant d’annuler l’opération.

Retours

Tâche qui représente l’opération de définition asynchrone.

Exceptions

key ou value est null.

Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.

Remarques

Cette méthode stocke dans la tâche toutes les exceptions de non-utilisation que l’équivalent synchrone de la méthode peut lever. Si une exception est stockée dans la tâche retournée, cette exception sera levée lorsque la tâche est attendue. Les exceptions d’utilisation, telles que ArgumentException, sont toujours levées de manière synchrone. Pour connaître les exceptions stockées, consultez les exceptions levées par SetString(IDistributedCache, String, String, DistributedCacheEntryOptions).

S’applique à