DistributedCacheExtensions.GetString(IDistributedCache, String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从具有指定键的指定缓存中获取字符串。
public:
[System::Runtime::CompilerServices::Extension]
static System::String ^ GetString(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key);
public static string? GetString(this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key);
static member GetString : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string -> string
<Extension()>
Public Function GetString (cache As IDistributedCache, key As String) As String
参数
- cache
- IDistributedCache
要在其中存储数据的缓存。
- key
- String
要获取其存储数据的密钥。
返回
存储缓存密钥中的字符串值。