using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; namespace Server; public class SpaceRaceDbContext : DbContext { public DbSet Laps { get; set; } public SpaceRaceDbContext(DbContextOptions options) : base(options) {} } [Index(nameof(UserId), nameof(Map), IsUnique = true)] [Index(nameof(Map))] public class Lap { public DateTimeOffset Created { get; set; } public Guid Id { get; set; } public Guid UserId { get; set; } public double Time { get; set; } [Required] public string Map { get; set; } }