Sparar poäng men visar inte

This commit is contained in:
2025-09-21 10:02:17 +02:00
parent 1bf42ef7e6
commit 0e2a283239
5 changed files with 91 additions and 7 deletions

View File

@ -71,6 +71,33 @@ public class CombinedRepository : ICombinedRepository
return result;
}
public IEnumerable<RoundBuilderElement> roundBuilderElementsDbById(int GameId)
{
var result = _context.RoundBuilderElements
.FromSqlRaw($@"
SELECT
gp.GamePointId,
gp.GameRoundId,
gp.GameRoundRegNr,
gp.GameRegPoints,
gr.GameRoundStartDate,
gr.GameStatus AS Status,
p.ParticipantId,
(p.LastName || ' ' || p.FirstName) AS ParticipantName
FROM GamePoints gp
INNER JOIN (
SELECT ParticipantId, GameRoundId, MAX(GamePointId) AS MaxGamePointId
FROM GamePoints
GROUP BY ParticipantId, GameRoundId
) latest ON gp.GamePointId = latest.MaxGamePointId
INNER JOIN GameRounds gr ON gp.GameRoundId = gr.GameRoundId
INNER JOIN Participants p ON gp.ParticipantId = p.ParticipantId
WHERE gp.GameRoundId = {GameId.ToString()}
ORDER BY gr.GameRoundStartDate DESC, p.LastName, p.FirstName, gp.GameRoundRegNr
")
.ToList();
return result;
}
public IEnumerable<RoundBuilderElement> roundBuilderElementsTotal()
{

View File

@ -7,6 +7,7 @@ public interface ICombinedRepository
{
IEnumerable<RoundBuilderElement> roundBuilderElements();
IEnumerable<RoundBuilderElement> roundBuilderElementsDb();
IEnumerable<RoundBuilderElement> roundBuilderElementsDbById(int GameId);
IEnumerable<RoundBuilderElement> roundBuilderElementsTotal();
IEnumerable<RoundBuilderElement> roundBuilderElementsTotalById(int roundId);
}