alastairtree / LazyCache

An easy to use thread safe in-memory caching service with a simple developer friendly API for c#
https://nuget.org/packages/LazyCache
MIT License
1.71k stars 159 forks source link

Create a sectioned IAppCache #166

Open kkd83 opened 3 years ago

kkd83 commented 3 years ago

[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.]

Is your feature request related to a problem? Please describe. Dependency injected I have an IAppCache which I can add items to but I have to build the key so there is no possible clash with another. This is usually fine but would be better if I could define a section dedicated to my types without worry of a clash.

Describe the solution you'd like I'm proposing adding an extension IAppCache GetSection(this IAppCache cache, string section) which would prepend the section to every key automatically.

This would be a very small non-breaking change.

Describe alternatives you've considered None that I can think of.

Additional context None.