DistributedCacheExtensions.GetString(IDistributedCache, String) 方法

定义

使用指定的键从指定的缓存中获取字符串。

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

要为其获取存储的数据的键。

返回

存储的缓存键中的字符串值。

适用于