DistributedCacheExtensions.Set(IDistributedCache, String, Byte[]) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定的快取中以指定的金鑰設定一串位元組。
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 為空值。