Sparar poäng men visar inte
This commit is contained in:
@ -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()
|
||||
{
|
||||
|
||||
@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user