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[]

要儲存在快取中的資料。

例外狀況

keyvalue 為 null。

適用於