internal void Nullify(ulong actionId) { lock (_lock) { _cache[actionId] = new ActivityCacheItem(); } }
public Activity Get(ulong actionId) { lock (_lock) { if (_cache.TryGetValue(actionId, out ActivityCacheItem item)) { item.LastAccess = DateTime.Now; return(item.Activity); } } //else var newitem = new ActivityCacheItem(); var action = ActivityActions.GetById((uint)actionId); if (action != null) { newitem.Activity = new Activity(action); } lock (_lock) { _cache[actionId] = newitem; } return(newitem.Activity); }