Skip to content

Refactor LazyCache to support the Options Pattern #128

@alastairtree

Description

@alastairtree

[Use the Thumbs Up reaction to vote for this feature, and please avoid adding comments like "+1" as they create noise for others watching the issue.]

LazyCache currently uses statics for some config such as default cache duration because of the age of the project. Remove all statics and instead use the more modern Options pattern with a strongly types options object which is more common in dotnet core. See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-3.1

CachingService should add a constructor dependency on IOptions<LazyCacheOptions> options.
LazyCacheOptions should have a properties for DefaultCacheDuration and NumberOfKeyLocks and anything else configurable.

This is a breaking change - requires a major version increase

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions