DistributedCacheExtensions.Set(IDistributedCache, String, Byte[]) Method

Definition

Sets a sequence of bytes in the specified cache with the specified key.

public static void Set (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value);

Parameters

cache
IDistributedCache

The cache in which to store the data.

key
String

The key to store the data in.

value
Byte[]

The data to store in the cache.

Exceptions

key or value is null.

Applies to

Өнім Нұсқалар
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)