語言

DistributedCacheExtensions.Set(IDistributedCache, String, Byte[]) 方法

定義

在指定的快取中以指定的金鑰設定一串位元組。

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

參數

cache
IDistributedCache

用來存放資料的快取。

key
String

用來存放資料的鑰匙。

value
Byte[]

要儲存在快取裡的資料。

例外狀況

key 或 value 為空值。

適用於