DefaultCacheKeyStrategy
The default cache key strategy for CachePolicy. Returns the property OperationKey.
using System;
using System.Runtime.CompilerServices;
namespace Polly.Caching
{
public class DefaultCacheKeyStrategy : ICacheKeyStrategy
{
[System.Runtime.CompilerServices.Nullable(1)]
public static readonly ICacheKeyStrategy Instance = new DefaultCacheKeyStrategy();
[System.Runtime.CompilerServices.NullableContext(1)]
public string GetCacheKey(Context context)
{
if (context == null)
throw new ArgumentNullException("context");
return context.OperationKey;
}
}
}