using Microsoft.Extensions.Caching.Distributed; namespace KBR.Cache { public interface IAppDistributedCache { T Get(string key) where T : class; Task GetAsync(string key, CancellationToken cancellationToken = default) where T : class; void Remove(string key); Task RemoveAsync(string key, CancellationToken cancellationToken = default); void Set(string key, T obj, DistributedCacheEntryOptions? options = default); Task SetAsync(string key, T obj, DistributedCacheEntryOptions? options = default, CancellationToken cancellationToken = default); TItem GetOrCreate(string key, Func factory) where TItem : class; Task GetOrCreateAsync(string key, Func> factory, CancellationToken cancellationToken = default) where TItem : class; } }