Table of Contents

Class CacheServiceExtensions

Namespace
JD.AI.Core.Caching
Assembly
JD.AI.Core.dll

Convenience extensions for working with string values.

public static class CacheServiceExtensions
Inheritance
CacheServiceExtensions
Inherited Members

Methods

GetStringAsync(IDistributedCacheService, string, CancellationToken)

Gets a cached string value.

public static Task<string?> GetStringAsync(this IDistributedCacheService cache, string key, CancellationToken ct = default)

Parameters

cache IDistributedCacheService
key string
ct CancellationToken

Returns

Task<string>

SetStringAsync(IDistributedCacheService, string, string, TimeSpan?, CancellationToken)

Sets a cached string value.

public static Task SetStringAsync(this IDistributedCacheService cache, string key, string value, TimeSpan? ttl = null, CancellationToken ct = default)

Parameters

cache IDistributedCacheService
key string
value string
ttl TimeSpan?
ct CancellationToken

Returns

Task