Class SerializingCacheProviderAsync<TResult, TSerialized>
Defines an IAsyncCacheProvider<TResult> which serializes objects of type TResult in and out of an underlying cache which caches as type TSerialized.  For use with asynchronous CachePolicy.
public class SerializingCacheProviderAsync<TResult, TSerialized> : IAsyncCacheProvider<TResult>
  Type Parameters
TResultThe return type of delegates which may be executed through the policy.
TSerializedThe type of serialized objects to be placed in the cache.
- Inheritance
 - 
      
      SerializingCacheProviderAsync<TResult, TSerialized>
 
- Implements
 - 
      IAsyncCacheProvider<TResult>
 
- Inherited Members
 
- Extension Methods
 
Constructors
SerializingCacheProviderAsync(IAsyncCacheProvider<TSerialized>, ICacheItemSerializer<TResult, TSerialized>)
Initializes a new instance of the SerializingCacheProviderAsync<TResult, TSerialized> class.
public SerializingCacheProviderAsync(IAsyncCacheProvider<TSerialized> wrappedCacheProvider, ICacheItemSerializer<TResult, TSerialized> serializer)
  Parameters
wrappedCacheProviderIAsyncCacheProvider<TSerialized>The wrapped cache provider.
serializerICacheItemSerializer<TResult, TSerialized>The serializer.
Exceptions
- ArgumentNullException
 wrappedCacheProvider
- ArgumentNullException
 serializer
Methods
GetAsync(string, CancellationToken, bool)
Gets a value from the cache asynchronously.
public Task<TResult> GetAsync(string key, CancellationToken cancellationToken, bool continueOnCapturedContext)
  Parameters
keystringThe cache key.
cancellationTokenCancellationTokenThe cancellation token.
continueOnCapturedContextboolWhether async calls should continue on a captured synchronization context.
Returns
- Task<TResult>
 A Task<TResult> promising as Result the value from cache; or null, if none was found.
PutAsync(string, TResult, Ttl, CancellationToken, bool)
Puts the specified value in the cache asynchronously.
public Task PutAsync(string key, TResult value, Ttl ttl, CancellationToken cancellationToken, bool continueOnCapturedContext)
  Parameters
keystringThe cache key.
valueTResultThe value to put into the cache.
ttlTtlThe time-to-live for the cache entry.
cancellationTokenCancellationTokenThe cancellation token.
continueOnCapturedContextboolWhether async calls should continue on a captured synchronization context.