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

GenericTtlStrategy<TResult>

class GenericTtlStrategy<TResult> : ITtlStrategy<TResult>
Represents a strongly-typed ITtlStrategy wrapper of a non-generic strategy.
using System; namespace Polly.Caching { internal class GenericTtlStrategy<TResult> : ITtlStrategy<TResult> { private readonly ITtlStrategy _wrappedTtlStrategy; internal GenericTtlStrategy(ITtlStrategy ttlStrategy) { if (ttlStrategy == null) throw new ArgumentNullException("ttlStrategy"); _wrappedTtlStrategy = ttlStrategy; } public Ttl GetTtl(Context context, TResult result) { return _wrappedTtlStrategy.GetTtl(context, result); } } }