Exemplo n.º 1
0
 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;
 }