DistributedCacheExtensions.SetString 方法

定义

重载

SetString(IDistributedCache, String, String)

使用指定的键在指定的缓存中设置字符串。

SetString(IDistributedCache, String, String, DistributedCacheEntryOptions)

使用指定的键在指定的缓存中设置字符串。

SetString(IDistributedCache, String, String)

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

使用指定的键在指定的缓存中设置字符串。

public:
[System::Runtime::CompilerServices::Extension]
 static void SetString(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, System::String ^ value);
public static void SetString (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value);
static member SetString : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string -> unit
<Extension()>
Public Sub SetString (cache As IDistributedCache, key As String, value As String)

参数

cache
IDistributedCache

用于存储数据的缓存。

key
String

用于存储数据的键。

value
String

要存储在缓存中的数据。

例外

keyvalue 为 null。

适用于

SetString(IDistributedCache, String, String, DistributedCacheEntryOptions)

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

使用指定的键在指定的缓存中设置字符串。

public:
[System::Runtime::CompilerServices::Extension]
 static void SetString(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, System::String ^ value, Microsoft::Extensions::Caching::Distributed::DistributedCacheEntryOptions ^ options);
public static void SetString (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options);
static member SetString : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions -> unit
<Extension()>
Public Sub SetString (cache As IDistributedCache, key As String, value As String, options As DistributedCacheEntryOptions)

参数

cache
IDistributedCache

用于存储数据的缓存。

key
String

用于存储数据的键。

value
String

要存储在缓存中的数据。

options
DistributedCacheEntryOptions

值的缓存选项。

例外

keyvalue 为 null。

适用于