Beispiel #1
0
        public override List <string> GetChildren(string uniqueId)
        {
            // If the storageCache is null, then loop through all the items and create the cache.
            // The lifecycle of the cache is expected to be of a single request, so there's no need to track changes made in the storage.
            List <string> result = new List <string>();

            if (storageCache == null)
            {
                storageCache = new ChildrenTracker(_stateManager);
                var uniqueIdToCheck = UniqueIDGenerator.UniqueIdSeparator + uniqueId;
                foreach (string id in GetAllItems())
                {
                    // No need to remove the WM_PREFIX, as the method GetAllItems already does
                    // var trimmedId = id.StartsWith(WM_PREFIX) ? id.Substring(3) : id;
                    storageCache.Add(id);
                }
            }
            return(storageCache.GetAllDependentKeys(uniqueId));
        }
Beispiel #2
0
 public void AddOrReplace(string key, T value)
 {
     storage.AddOrReplace(key, value);
     childrenTracker.Add(key);
 }