void UpdateExistingCodeFeature(IUpdateContextCodeFeature update, CodeFeatureId codeFeatureId, ICachedContextFeatureState existingContext, ICachedCodeFeatureState existingCode) { var featureState = new CachedCodeFeatureState(codeFeatureId, update.Enabled); bool updated = existingContext.TryUpdate(codeFeatureId, featureState, existingCode); if (updated) { NotifyUpdated(update, featureState); } }
public bool TryAdd(string key, ICachedContextFeatureState contextFeatureState) { return(_cache.TryAdd(key, contextFeatureState)); }
public bool TryGetContextFeatureState(string key, out ICachedContextFeatureState featureState) { return(_cache.TryGet(key, out featureState)); }
public bool TryGetContextFeatureState(TContext context, out ICachedContextFeatureState featureState) { string key = _keyProvider.GetKey(context); return(_cache.TryGetContextFeatureState(key, out featureState)); }