Add configuration by code for System.Runtime.Caching memory options #177#228
Add configuration by code for System.Runtime.Caching memory options #177#228MichaConrad merged 3 commits intoMichaCo:devfrom
Conversation
MichaConrad
left a comment
There was a problem hiding this comment.
Looks very good overall! ;)
For unit testing, can you add/change one of the shared cache configurations used by many other tests to use the new way of configuring this cache handle?
For example, change this one https://github.com/MichaCo/CacheManager/blob/dev/test/CacheManager.Tests/TestCacheManagers.cs#L332
Many other tests use that collection of different caches to run tests against it. That's basically a test matrix for many different configurations.
|
I had made the change to throw an exception when trying to set options for the Default cache. I have also added some more tests, including a test expecting the exception.
What kind of change do you suggest? Something like this? I'm asking because I don't want to break any test by, for instance, setting a cache too small or by changing the number of cache handles |
|
Great! |
In response to #177 the
RuntimeMemoryCacheOptionsclass was created to allow configuring theSystem.Runtime.Caching.MemoryCache.All overloads of the extension method
WithSystemRuntimeCacheHandlewith aRuntimeMemoryCacheOptionsparameter also requires theinstanceNameparameter because as I understand it, it is not possible to change the Default cache settings.Configuration with web/app configuration system still works as before and I think is the only way to configure the default cache.
For the MS.Extensions.Configuration I think I would need some guidance.