MethodCache.Fody
MethodCache.Fody copied to clipboard
A method cache Fody plugin
Setting the Fody `ShouldCleanReference` property to `true` will only result in removing the fody references. But our Cache and NoCache attributes will then be "re-referenced" to the `Microsoft.Extensions.Caching.Abstractions` namespace and...
This will be necessary if users want to mix `IMemoryCache` and `IDistributedCache` (assuming implementation of #3 and #4) within one class. Users can explicitly specify which Cache property or field...
Support usage of default values via FodyWeavers.xml configuration where appropriate (e.g. for default values of #6, #8).
Implement a `[NoKey]` attribute (or similar), that excludes the respective parameter from key creating. This is suitable for parameters that do not alter the outcome of the cached method and...
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`...
Implement the options similar to #6 for DistributedCache. `DistributedCacheEntryOptions` does not support a Priority, so we could display a warning and skip the priority property. Remaining 2 properties to consider:...
Support caching of static methods (properties). This assumes a static Cache property (field). Might be something that users have to opt-in.
Similar to what was supported by the old [MethodCache](https://github.com/Dresel/MethodCache). Users can opt-in to enable caching of properties. This will be configurable via the `[Cache]` attribute.
Related to #3. For the second iteration, the following `IDistributedCache` methods should be used if the method that is going to be weaved is `async`. If a `CancellationToken` is passed...