public static Dictionary <int, List <AchievementRewardInfo> > LoadAchievementRewardInfoDB(Dictionary <int, AchievementInfo> achievementInfos)
        {
            Dictionary <int, List <AchievementRewardInfo> > dictionary = new Dictionary <int, List <AchievementRewardInfo> >();

            using (ProduceBussiness bussiness = new ProduceBussiness())
            {
                AchievementRewardInfo[] aLlAchievementReward = bussiness.GetALlAchievementReward();
                using (Dictionary <int, AchievementInfo> .ValueCollection.Enumerator enumerator = achievementInfos.Values.GetEnumerator())
                {
                    Func <AchievementRewardInfo, bool> predicate = null;
                    AchievementInfo achievementInfo;
                    while (enumerator.MoveNext())
                    {
                        achievementInfo = enumerator.Current;
                        if (predicate == null)
                        {
                            predicate = s => s.AchievementID == achievementInfo.ID;
                        }
                        IEnumerable <AchievementRewardInfo> source = aLlAchievementReward.Where <AchievementRewardInfo>(predicate);
                        dictionary.Add(achievementInfo.ID, source.ToList <AchievementRewardInfo>());
                    }
                }
            }
            return(dictionary);
        }
Beispiel #2
0
        public static Dictionary <int, List <AchievementRewardInfo> > LoadAchievementRewardInfoDB(Dictionary <int, AchievementInfo> achievementInfos)
        {
            Dictionary <int, List <AchievementRewardInfo> > list = new Dictionary <int, List <AchievementRewardInfo> >();

            using (ProduceBussiness db = new ProduceBussiness())
            {
                AchievementRewardInfo[] infos = db.GetALlAchievementReward();
                foreach (AchievementInfo achievementInfo in achievementInfos.Values)
                {
                    IEnumerable <AchievementRewardInfo> temp =
                        from s in infos
                        where s.AchievementID == achievementInfo.ID
                        select s;
                    list.Add(achievementInfo.ID, temp.ToList <AchievementRewardInfo>());
                }
            }
            return(list);
        }
Beispiel #3
0
        public static Dictionary <int, List <AchievementRewardInfo> > LoadAchievementRewardInfoDB(Dictionary <int, AchievementInfo> achievementInfos)
        {
            Dictionary <int, List <AchievementRewardInfo> > dictionary = new Dictionary <int, List <AchievementRewardInfo> >();

            using (ProduceBussiness produceBussiness = new ProduceBussiness())
            {
                AchievementRewardInfo[] achievementReward = produceBussiness.GetALlAchievementReward();
                using (Dictionary <int, AchievementInfo> .ValueCollection.Enumerator enumerator = achievementInfos.Values.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AchievementInfo achievementInfo            = enumerator.Current;
                        IEnumerable <AchievementRewardInfo> source = Enumerable.Where <AchievementRewardInfo>((IEnumerable <AchievementRewardInfo>)achievementReward, (Func <AchievementRewardInfo, bool>)(s => s.AchievementID == achievementInfo.ID));
                        dictionary.Add(achievementInfo.ID, Enumerable.ToList <AchievementRewardInfo>(source));
                    }
                }
            }
            return(dictionary);
        }