private void BuildCategoryList() { var perksAvailable = PerkService.GetPerksAvailableToPC(GetPC()); var categoryIDs = perksAvailable.Select(x => x.PerkCategoryID).Distinct(); List <PerkCategory> categories = DataService.Where <PerkCategory>(x => categoryIDs.Contains(x.ID)).ToList(); ClearPageResponses("CategoryPage"); foreach (PerkCategory category in categories) { AddResponseToPage("CategoryPage", category.Name, true, category.ID); } }
private void BuildPerkList() { Model vm = GetDialogCustomData <Model>(); var perksAvailable = PerkService.GetPerksAvailableToPC(GetPC()); List <Data.Entity.Perk> perks = perksAvailable.Where(x => x.PerkCategoryID == vm.SelectedCategoryID).ToList(); ClearPageResponses("PerkListPage"); foreach (Data.Entity.Perk perk in perks) { AddResponseToPage("PerkListPage", perk.Name, true, perk.ID); } }