示例#1
0
        private List <TItem> LoadFromCache()
        {
            if (_cacheKey == null)
            {
                return(null);
            }

            var list   = CacheStorage.GetStringList(_cacheKey);
            var result = new List <TItem>((list as IReadOnlyList <string>)?.Count ?? 50);

            foreach (var obj in list)
            {
                var item = LoadFromCache(obj);
                if (item != null)
                {
                    result.AddSorted(item, this);
                }
            }

            result.Capacity = result.Count;
            return(result);
        }