DistributedCacheExtensions.SetString 方法

定義

多載

SetString(IDistributedCache, String, String)

使用指定的索引鍵,在指定的快取中設定字串。

SetString(IDistributedCache, String, String, DistributedCacheEntryOptions)

使用指定的索引鍵,在指定的快取中設定字串。

SetString(IDistributedCache, String, String)

來源:
DistributedCacheExtensions.cs
來源:
DistributedCacheExtensions.cs
來源:
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)

來源:
DistributedCacheExtensions.cs
來源:
DistributedCacheExtensions.cs
來源:
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。

適用於