It's a wrapper library for [Microsoft.Extensions.Caching.Memory.MemoryCache] targeting .net core 2.0, allow you to create multiple instances from MemoryCache Type and keep them all under your control in a centralized-place which is CacheManager.
This project is available as NuGet package being updated after each successfull build (continuous integration).
You can navigate to NuGet link https://www.nuget.org/packages/CachingManager
You can also install to your project as simple as :
PM> Install-Package CachingManager
using CachingManager;
var cache = CacheFactory.CreateCache<User, int>("Users cache", 10 * 1024);
var user = new User() {Id = 10, Name = "Alden" };
cache[user.Id] = user;
var cachedCopy = cache[user.Id];
List<ICache> caches = CacheManager.Instance.ListCaches();
foreach (var cache in caches)
{
// clear cache
cache.Clear();
//cache properties
string name = cache.Name;
long sizeLimit = cache.SizeLimit;
}
CacheManager.Instance.ClearAll();
Feel free to contribute to this repository, you can reach me out by the email eng.ngmalden@gmail.com