protected override IEnumerable <ScoreboardSortModel> GetEnumerable() { cats2 = Categories.ToDictionary(t => t.CategoryId); var rt = RankCache .Where(a => cats2.ContainsKey(a.Team.CategoryId)) .GroupBy(a => cats2[a.Team.CategoryId].SortOrder) .OrderBy(g => g.Key); foreach (var g in rt) { var prob = new ScoreboardProblemStatisticsModel[Problems.Length]; for (int i = 0; i < Problems.Length; i++) { prob[i] = new ScoreboardProblemStatisticsModel(); } yield return(new ScoreboardSortModel(GetViewModel(IsPublic, g, prob), prob)); } }