<PackageReference Include="Polly" Version="7.2.1" />

AsyncSerializingCacheProvider<TResult, TSerialized>

public class AsyncSerializingCacheProvider<TResult, TSerialized> : IAsyncCacheProvider<TResult>
Defines an IAsyncCacheProvider<T> which serializes objects of type TResult in and out of an underlying cache which caches as type TSerialized. For use with asynchronous CachePolicy.
public AsyncSerializingCacheProvider(IAsyncCacheProvider<TSerialized> wrappedCacheProvider, ICacheItemSerializer<TResult, TSerialized> serializer)

Initializes a new instance of the AsyncSerializingCacheProvider<T, U> class.

public Task PutAsync(string key, TResult value, Ttl ttl, CancellationToken cancellationToken, bool continueOnCapturedContext)

Puts the specified value in the cache asynchronously.

public Task<ValueTuple<bool, TResult>> TryGetAsync(string key, CancellationToken cancellationToken, bool continueOnCapturedContext)

Gets a value from the cache asynchronously.