Beispiel #1
0
        public async Task <IEnumerable <UserProfile> > GetAllAsync()
        {
            if (allItemsLoaded)
            {
                return(cachedUserProfiles.Values);
            }
            var items = await dataApiClient.GetAllUserProfiles();

            items
            .Where(item => !cachedUserProfiles.ContainsKey(item.Username))
            .ForEach(item => cachedUserProfiles.Add(item.Username, item));
            allItemsLoaded = true;
            return(items);
        }