RedisCache Classe
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Implémentation de cache distribué à l’aide de Redis.
Utilise StackExchange.Redis comme client Redis.
public ref class RedisCache : IDisposable, Microsoft::Extensions::Caching::Distributed::IBufferDistributedCache
public class RedisCache : IDisposable, Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache
type RedisCache = class
interface IBufferDistributedCache
interface IDistributedCache
interface IDisposable
Public Class RedisCache
Implements IBufferDistributedCache, IDisposable
- Héritage
-
RedisCache
- Implémente
Constructeurs
| Nom | Description |
|---|---|
| RedisCache(IOptions<RedisCacheOptions>) |
Initialise une nouvelle instance de RedisCache. |
Méthodes
| Nom | Description |
|---|---|
| Dispose() |
Effectue des tâches définies par l’application associées à la libération, à la libération ou à la réinitialisation des ressources non managées. |
| Get(String) |
Obtient une valeur avec la clé donnée. |
| GetAsync(String, CancellationToken) |
Obtient une valeur avec la clé donnée. |
| Refresh(String) |
Actualise une valeur dans le cache en fonction de sa clé, réinitialisant son délai d’expiration glissant (le cas échéant). |
| RefreshAsync(String, CancellationToken) |
Actualise une valeur dans le cache en fonction de sa clé, réinitialisant son délai d’expiration glissant (le cas échéant). |
| Remove(String) |
Supprime la valeur avec la clé donnée. |
| RemoveAsync(String, CancellationToken) |
Supprime la valeur avec la clé donnée. |
| Set(String, Byte[], DistributedCacheEntryOptions) |
Définit une valeur avec la clé donnée. |
| SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken) |
Définit la valeur avec la clé donnée. |
Implémentations d’interfaces explicites
| Nom | Description |
|---|---|
| IBufferDistributedCache.Set(String, ReadOnlySequence<Byte>, DistributedCacheEntryOptions) |
Implémentation de cache distribué à l’aide de Redis. Utilise |
| IBufferDistributedCache.SetAsync(String, ReadOnlySequence<Byte>, DistributedCacheEntryOptions, CancellationToken) |
Implémentation de cache distribué à l’aide de Redis. Utilise |
| IBufferDistributedCache.TryGet(String, IBufferWriter<Byte>) |
Implémentation de cache distribué à l’aide de Redis. Utilise |
| IBufferDistributedCache.TryGetAsync(String, IBufferWriter<Byte>, CancellationToken) |
Implémentation de cache distribué à l’aide de Redis. Utilise |
Méthodes d’extension
| Nom | Description |
|---|---|
| GetString(IDistributedCache, String) |
Obtient une chaîne du cache spécifié avec la clé spécifiée. |
| GetStringAsync(IDistributedCache, String, CancellationToken) |
Obtient de façon asynchrone une chaîne à partir du cache spécifié avec la clé spécifiée. |
| Set(IDistributedCache, String, Byte[]) |
Définit une séquence d’octets dans le cache spécifié avec la clé spécifiée. |
| SetAsync(IDistributedCache, String, Byte[], CancellationToken) |
Définit de façon asynchrone une séquence d’octets dans le cache spécifié avec la clé spécifiée. |
| SetString(IDistributedCache, String, String, DistributedCacheEntryOptions) |
Définit une chaîne dans le cache spécifié avec la clé spécifiée. |
| SetString(IDistributedCache, String, String) |
Définit une chaîne dans le cache spécifié avec la clé spécifiée. |
| SetStringAsync(IDistributedCache, String, String, CancellationToken) |
Définit de façon asynchrone une chaîne dans le cache spécifié avec la clé spécifiée. |
| SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions, CancellationToken) |
Définit de façon asynchrone une chaîne dans le cache spécifié avec la clé spécifiée. |