Memory Cache in dotnet core
I am trying to write a class to handle Memory cache in a .net core class library. If I use not the core then I could write using System.Runtime.Caching; using System.Collections.Concurrent; namespace n{ public class MyCache { readonly MemoryCache _cache; readonly Func<CacheItemPolicy> _cachePolicy; static readonly ConcurrentDictionary<string, object> _theLock = new ConcurrentDictionary<string, object>(); public MyCache(){ _cache = MemoryCache.Default; _cachePolicy = () => new CacheItemPolicy { SlidingExpiration = TimeSpan.FromMinutes(15), RemovedCallback = x => { object o; _theLock.TryRemove(x