public List <BranchViewModel> GetAllWithPerks(MajorType major) { var branches = _branchRepository.Select().ProjectTo <BranchViewModel>(MapperConfig).ToList(); foreach (var branch in branches) { branch.Perks = branch.Perks.SelectMany(x => _perkService.GetPerkRanks(x)).ToList(); } return(branches); }