Skip to content

Refactor LazyCache to support the Options Pattern #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alastairtree opened this issue Sep 21, 2020 · 0 comments
Open

Refactor LazyCache to support the Options Pattern #128

alastairtree opened this issue Sep 21, 2020 · 0 comments

Comments

@alastairtree
Copy link
Owner

alastairtree commented Sep 21, 2020

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant