MethodCache.Fody
MethodCache.Fody copied to clipboard
Support fields for cache retrieval
Instead of only looking for a property that implements IMemoryCache / IDistributedCache we shall also allow fields.
In case both a property and a field of type IMemoryCache / IDistributedCache is found in the class, the property will implicitly take precedence.
Code sample:
[Cache]
public class BasicSample
{
public BasicSample(IMemoryCache memoryCache)
{
MemoryCache = memoryCache;
}
protected IMemoryCache MemoryCache;
// ...
}