Class CacheServiceExtensions
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
cacheIDistributedCacheServicekeystringctCancellationToken
Returns
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
cacheIDistributedCacheServicekeystringvaluestringttlTimeSpan?ctCancellationToken