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);
            }
        }
예제 #2
0
 public bool TryAdd(string key, ICachedContextFeatureState contextFeatureState)
 {
     return(_cache.TryAdd(key, contextFeatureState));
 }
예제 #3
0
 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));
        }