<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.11" />

Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions

public static class DistributedCacheExtensions
Extension methods for setting data in an IDistributedCache.
public static string GetString(this IDistributedCache cache, string key)

Gets a string from the specified cache with the specified key.

public static Task<string> GetStringAsync(this IDistributedCache cache, string key, CancellationToken token = default)

Asynchronously gets a string from the specified cache with the specified key.

public static void Set(this IDistributedCache cache, string key, byte[] value)

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

public static Task SetAsync(this IDistributedCache cache, string key, byte[] value, CancellationToken token = default)

Asynchronously sets a sequence of bytes in the specified cache with the specified key.

public static void SetString(this IDistributedCache cache, string key, string value)

Sets a string in the specified cache with the specified key.

public static void SetString(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options)

Sets a string in the specified cache with the specified key.

public static Task SetStringAsync(this IDistributedCache cache, string key, string value, CancellationToken token = default)

Asynchronously sets a string in the specified cache with the specified key.

public static Task SetStringAsync(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options, CancellationToken token = default)

Asynchronously sets a string in the specified cache with the specified key.