Beispiel #1
0
        public async Task <IEnumerable <News> > GetAllNews()
        {
            IEnumerable <News> allNews = await newsStore.GetAll();

            allNews = await allNews.MapAsync(async news => { // Include localData from the cache:
                news.localData = await localCache.Get(news.key, null);
                return(news);
            });

            allNews = allNews.OrderByDescending(x => x.GetDate(true));
            return(allNews);
        }
        public static async Task <IEnumerable <UsageRule> > GetRulesInitialized(this KeyValueStoreTypeAdapter <UsageRule> self, LocalAnalytics analytics)
        {
            var rules = await self.GetAll();

            foreach (var rule in rules)
            {
                if (!rule.concatRuleIds.IsNullOrEmpty())
                {
                    rule.andRules = new List <UsageRule>();
                    foreach (var id in rule.concatRuleIds)
                    {
                        rule.andRules.Add(await self.Get(id, null));
                    }
                }
                if (rule.isTrue == null)
                {
                    rule.SetupUsing(analytics);
                }
            }
            return(rules);
        }
Beispiel #3
0
        public async Task <IEnumerable <T> > GetAllFeatureFlags()
        {
            var all = await featureFlagStore.GetAll();

            return(await all.MapAsync(async x => await ReturnInitializedFlag(x)));
        }