private Dictionary <Season, int> EstimateAllTimeRanking() { PropertyInfo propInfo = new EstimatedRankings().GetType().GetProperty(_team.Name.Replace(' ', '_').Replace('.', '_')); Dictionary <Season, int> estimatedRanking = new Dictionary <Season, int>(); foreach (Season season in Enum.GetValues(typeof(Season))) { string poId = string.Format("{0} {1}", season, Month.PlayOffs); int score = 0; try { score = Convert.ToInt32(propInfo.GetValue(_estimatedRankingRepository.First(x => x.ID == poId))); } catch { } estimatedRanking.Add(season, score); } return(estimatedRanking); }