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.72k stars 159 forks source link

Suggestion for improvement of QuickStart documentation #80

Open RedFeet opened 5 years ago

RedFeet commented 5 years ago

Could you add an example to the (Quick Start) documentation on "how to configure LazyCache options" in the DI container scenario? Is this the correct way?

public SomeClass(IAppCache cache) {
    _cache = cache;  
    _cache.DefaultCachePolicy.DefaultCacheDurationSeconds = 60 * 60; 
}  
alastairtree commented 4 years ago

What you hve done is correct but frankly the current DefaultCachePolicy is a bit ugly and unusual and could do with a re-write to use the new Options pattern that is common with dotnet core.