using System.Collections.Generic; using Microsoft.EntityFrameworkCore; namespace Content.Server.Database { public class PreferencesDbContext : DbContext { // This is used by the "dotnet ef" CLI tool. public PreferencesDbContext() : base(new DbContextOptionsBuilder().UseSqlite("Data Source=:memory:").Options) { } public PreferencesDbContext(DbContextOptions options) : base(options) { } public DbSet Preferences { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasIndex(p => p.Username) .IsUnique(); } } public class Prefs { public int PrefsId { get; set; } public string Username { get; set; } = null!; public int SelectedCharacterSlot { get; set; } public List HumanoidProfiles { get; } = new List(); } public class HumanoidProfile { public int HumanoidProfileId { get; set; } public int Slot { get; set; } public string SlotName { get; set; } = null!; public string CharacterName { get; set; } = null!; public int Age { get; set; } public string Sex { get; set; } = null!; public string HairName { get; set; } = null!; public string HairColor { get; set; } = null!; public string FacialHairName { get; set; } = null!; public string FacialHairColor { get; set; } = null!; public string EyeColor { get; set; } = null!; public string SkinColor { get; set; } = null!; public int PrefsId { get; set; } public Prefs Prefs { get; set; } = null!; } }