public void OnGet() { if (User.IsInRole("Admin")) { Teams = teamData.GetAllTeams().Where(t => t.IsPublic == true); IEnumerable <OmadaTeam> privateTeams = teamData.GetUserTeams(userManager.GetUserId(HttpContext.User)) .Where(t => t.IsPublic == false); Teams = Teams.Concat(privateTeams); } else if (User.IsInRole("Team Leader")) { Teams = teamData.GetLeaderTeams(userManager.GetUserId(HttpContext.User)); } foreach (var team in Teams) { var averages = averagesCalculate.GetSurveysAverages(team); var opinions = averagesCalculate.GetOpinionsFromCurrentWeek(team, AveragesCalculate.GetCurrentWeek()); AverageWeeks.Add(team.Name, averages); TeamsOpinions.Add(team.Name, opinions); } }