IDistributedCache 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示序列化值的分布式缓存。
public interface class IDistributedCache
public interface IDistributedCache
type IDistributedCache = interface
Public Interface IDistributedCache
- 派生
方法
Get(String) |
获取具有给定键的值。 |
GetAsync(String, CancellationToken) |
获取具有给定键的值。 |
Refresh(String) |
基于缓存中某个值的键刷新该值,并重置其可调到期超时(如果有)。 |
RefreshAsync(String, CancellationToken) |
基于缓存中某个值的键刷新该值,并重置其可调到期超时(如果有)。 |
Remove(String) |
删除具有给定键的值。 |
RemoveAsync(String, CancellationToken) |
删除具有给定键的值。 |
Set(String, Byte[], DistributedCacheEntryOptions) |
设置具有给定键的值。 |
SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken) |
设置具有给定键的值。 |
扩展方法
GetString(IDistributedCache, String) |
使用指定的键从指定的缓存中获取字符串。 |
GetStringAsync(IDistributedCache, String, CancellationToken) |
使用指定的键从指定的缓存异步获取字符串。 |
Set(IDistributedCache, String, Byte[]) |
使用指定的键设置指定缓存中的字节序列。 |
SetAsync(IDistributedCache, String, Byte[], CancellationToken) |
使用指定的键异步设置指定缓存中的字节序列。 |
SetString(IDistributedCache, String, String) |
使用指定的键在指定的缓存中设置字符串。 |
SetString(IDistributedCache, String, String, DistributedCacheEntryOptions) |
使用指定的键在指定的缓存中设置字符串。 |
SetStringAsync(IDistributedCache, String, String, DistributedCacheEntryOptions, CancellationToken) |
使用指定的键在指定的缓存中异步设置字符串。 |
SetStringAsync(IDistributedCache, String, String, CancellationToken) |
使用指定的键在指定的缓存中异步设置字符串。 |
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈