CacheAspect.Repository.AzureCache.UpdateCacheKeys C# (CSharp) Метод

UpdateCacheKeys() приватный Метод

Update the cache keys list.
private UpdateCacheKeys ( string key ) : void
key string New key to add to the cache key list, if it doesn't already exist.
Результат void
        private void UpdateCacheKeys(string key)
        {
            if (key.Equals(CacheKeys))
            {
                throw new ArgumentException("The current cache key cannot be used as it's already employed by the system.", "key");
            }

            IList<string> cacheKeys;
            var cacheKeysObject = _dataCache.Get(CacheKeys);

            if (cacheKeysObject == null)
            {
                cacheKeys = new List<string>();
            }
            else
            {
                cacheKeys = (List<string>)cacheKeysObject;

                if (cacheKeys.Contains(key))
                {
                    return;
                }
            }

            cacheKeys.Add(key);
            _dataCache.Put(CacheKeys, cacheKeys, _defaultTimeout);
        }