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

Polly.Caching.SerializingCacheProvider<TResult, TSerialized>

public class SerializingCacheProvider<TResult, TSerialized> : ISyncCacheProvider<TResult>
Defines an ISyncCacheProvider<T> which serializes objects of type TResult in and out of an underlying cache which caches as type TSerialized. For use with synchronous CachePolicy.
namespace Polly.Caching { public class SerializingCacheProvider<[System.Runtime.CompilerServices.Nullable(2)] TResult, [System.Runtime.CompilerServices.Nullable(2)] TSerialized> : ISyncCacheProvider<TResult> { public SerializingCacheProvider(ISyncCacheProvider<TSerialized> wrappedCacheProvider, ICacheItemSerializer<TResult, TSerialized> serializer); public (bool, TResult) TryGet(string key); public void Put(string key, TResult value, Ttl ttl); } }