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

要获取其存储数据的密钥。

返回

存储缓存密钥中的字符串值。

适用于