Skip to content

Support fields for cache retrieval #9

@pergerch

Description

@pergerch

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;

    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions