From 5c2d617af79a093f3136c9c0c296e40d7d97b8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20T=C3=B3th?= Date: Mon, 9 Dec 2024 12:21:47 +0100 Subject: [PATCH] group by fix --- .../Functions/ListGrades/GradeListing.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grade-management/Ahk.GradeManagement/Functions/ListGrades/GradeListing.cs b/grade-management/Ahk.GradeManagement/Functions/ListGrades/GradeListing.cs index 5ba8e9e7..ff877c77 100644 --- a/grade-management/Ahk.GradeManagement/Functions/ListGrades/GradeListing.cs +++ b/grade-management/Ahk.GradeManagement/Functions/ListGrades/GradeListing.cs @@ -16,12 +16,12 @@ public async Task> List(string repoPrefix { var items = await this.repo.ListConfirmedWithRepositoryPrefix(Normalize.RepoName(repoPrefix)); var finalResults = new List(); - foreach (var student in items.GroupBy(r => Normalize.Neptun(r.Neptun))) + foreach (var student in items.GroupBy(r => new { Neptun = Normalize.Neptun(r.Neptun), r.GitHubRepoName })) { var lastResult = student.OrderByDescending(s => s.Date).First(); finalResults.Add(new FinalStudentGrade( - neptun: student.Key, - repo: lastResult.GitHubRepoName, + neptun: student.Key.Neptun, + repo: lastResult.Key.GitHubRepoName, prUrl: lastResult.GitHubPrUrl, points: lastResult.Points == null ? new Dictionary() : lastResult.Points.ToDictionary(keySelector: p => p.Name, elementSelector: p => p.Point))); }