implement startup database loading (path still hardcoded)

This commit is contained in:
2024-09-20 19:01:09 +02:00
parent 275e6de228
commit 63761001fa
4 changed files with 94 additions and 16 deletions

View File

@ -0,0 +1,23 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace StarsAssistant.Model;
public class Game
{
/// <summary>
/// Dummy primary key, normally not used, but makes working with EF easier.
/// </summary>
public int GameId { get; set; }
/// <summary>
/// The base path in which all game files reside.
/// </summary>
public string GamePath { get; set; } = String.Empty;
/// <summary>
/// The base name without extensions of your game, inside the GamePath folder.
/// All dependant files are resolved using this name.
/// </summary>
public string BaseName { get; set; } = String.Empty;
}

View File

@ -37,7 +37,7 @@ public class StarsDatabase(string DbPath) : DbContext
/// <summary>
/// The record with all game metadata, will only contain a single line at all times.
/// </summary>
// public DbSet<Game> Game { get; set; }
public DbSet<Game> Game { get; set; }
#endregion
}