From 1b4cd53234ffa34df7154ca82bd8df448525b78e Mon Sep 17 00:00:00 2001 From: Pieter-Bas IJdens Date: Sun, 13 Oct 2024 11:57:13 +0200 Subject: [PATCH] Version 1.0.18 Fixed match list retrieval tro include competition metadata --- CentaurScores/Services/MatchRepository.cs | 7 ++++++- CentaurScores/version.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CentaurScores/Services/MatchRepository.cs b/CentaurScores/Services/MatchRepository.cs index 9697c48..26703ff 100644 --- a/CentaurScores/Services/MatchRepository.cs +++ b/CentaurScores/Services/MatchRepository.cs @@ -163,7 +163,12 @@ public async Task> FindMatches() db.Database.EnsureCreated(); int activeID = await FetchActiveID(db); - List entities = await db.Matches.AsNoTracking().OrderByDescending(entity => entity.MatchCode).ToListAsync(); + List entities = await db.Matches.AsNoTracking() + .Include(x => x.Competition) + .Where(entity => entity.Competition != null) + .OrderBy(entity => entity.Competition!.Name) + .OrderByDescending(entity => entity.MatchCode) + .ToListAsync(); List result = entities.Select(x => x.ToModel()).Select(x => { x.IsActiveMatch = x.Id == activeID; diff --git a/CentaurScores/version.json b/CentaurScores/version.json index c720f33..7765e3b 100644 --- a/CentaurScores/version.json +++ b/CentaurScores/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.17" + "version": "1.0.18" } \ No newline at end of file