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

CacheProviderExtensions

public static class CacheProviderExtensions
Class that provides helper methods for configuring CacheProviders.
public static IAsyncCacheProvider<TCacheFormat> AsyncFor<TCacheFormat>(this IAsyncCacheProvider nonGenericCacheProvider)

Provides a strongly TCacheFormat-typed version of the supplied IAsyncCacheProvider

public static ISyncCacheProvider<TCacheFormat> For<TCacheFormat>(this ISyncCacheProvider nonGenericCacheProvider)

Provides a strongly TCacheFormat-typed version of the supplied ISyncCacheProvider

public static SerializingCacheProvider<TSerialized> WithSerializer<TSerialized>(this ISyncCacheProvider<TSerialized> cacheProvider, ICacheItemSerializer<object, TSerialized> serializer)

Wraps the serializer around the cacheProvider so that delegate return values of any type can be stored in the cache as type TSerialized.

public static SerializingCacheProvider<TResult, TSerialized> WithSerializer<TResult, TSerialized>(this ISyncCacheProvider<TSerialized> cacheProvider, ICacheItemSerializer<TResult, TSerialized> serializer)

Wraps the serializer around the cacheProvider so that delegate return values of type TResult can be stored in the cache as type TSerialized.

public static AsyncSerializingCacheProvider<TSerialized> WithSerializer<TSerialized>(this IAsyncCacheProvider<TSerialized> cacheProvider, ICacheItemSerializer<object, TSerialized> serializer)

Wraps the serializer around the asynchronous cacheProvider so that delegate return values of any type can be stored in the cache as type TSerialized.

public static AsyncSerializingCacheProvider<TResult, TSerialized> WithSerializer<TResult, TSerialized>(this IAsyncCacheProvider<TSerialized> cacheProvider, ICacheItemSerializer<TResult, TSerialized> serializer)

Wraps the serializer around the asynchronous cacheProvider so that delegate return values of type TResult can be stored in the cache as type TSerialized.