<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="11.0.0-preview.3.26207.106" />

Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions

public static class DistributedCacheExtensions
Extension methods for setting data in an IDistributedCache.
namespace Microsoft.Extensions.Caching.Distributed { public static class DistributedCacheExtensions { public static void Set(this IDistributedCache cache, string key, byte[] value); public static Task SetAsync(this IDistributedCache cache, string key, byte[] value, CancellationToken token = default(CancellationToken)); public static void SetString(this IDistributedCache cache, string key, string value); public static void SetString(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options); public static Task SetStringAsync(this IDistributedCache cache, string key, string value, CancellationToken token = default(CancellationToken)); public static Task SetStringAsync(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)); public static string GetString(this IDistributedCache cache, string key); public static Task<string> GetStringAsync(this IDistributedCache cache, string key, CancellationToken token = default(CancellationToken)); } }