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

Polly.Caching.SerializingCacheProvider<TSerialized>

public class SerializingCacheProvider<TSerialized> : ISyncCacheProvider
Defines an ISyncCacheProvider which serializes objects of any type 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)] TSerialized> : ISyncCacheProvider { public SerializingCacheProvider(ISyncCacheProvider<TSerialized> wrappedCacheProvider, ICacheItemSerializer<object, TSerialized> serializer); public (bool, object) TryGet(string key); public void Put(string key, object value, Ttl ttl); } }