public TCacheDataModel GetItem <TCacheDataModel>(CacheKey key) where TCacheDataModel : ICacheDataModel { return(_memoryCache.GetOrCreate(key.GetEnumMemberAttrValue(), entry => { entry.Priority = CacheItemPriority.NeverRemove; return Activator.CreateInstance <TCacheDataModel>(); })); }
public void RemoveItem(CacheKey key) { _memoryCache.Remove(key.GetEnumMemberAttrValue()); _memoryCacheKeys.Remove(key); }