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 为 null。