Samlar ihop och visar poäng från databasen

This commit is contained in:
2025-09-20 09:57:47 +02:00
parent 066503da74
commit 1bf42ef7e6
6 changed files with 109 additions and 16 deletions

View File

@ -14,6 +14,8 @@ public class DataContext : DbContext
public DbSet<GamePoint> GamePoints { get; set; }
public DbSet<GameRound> GameRounds { get; set; }
public DbSet<RoundBuilderElement> RoundBuilderElements { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
@ -33,7 +35,7 @@ public class DataContext : DbContext
new GamePoint { GamePointId = 3, ParticipantId = 3, GameRoundId = 2, GameDate = new DateTime(2025, 10, 15, 20, 12, 15), GameRoundRegNr = 2, GameRegPoints = 1000 },
new GamePoint { GamePointId = 4, ParticipantId = 3, GameRoundId = 2, GameDate = new DateTime(2025, 10, 15, 20, 20, 15), GameRoundRegNr = 4, GameRegPoints = 400 }
);
modelBuilder.Entity<RoundBuilderElement>().HasNoKey();
}
}