implement startup database loading (path still hardcoded)
This commit is contained in:
		
							
								
								
									
										23
									
								
								Stars Assistant/Model/Game.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Stars Assistant/Model/Game.cs
									
									
									
									
									
										Normal 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;
 | 
			
		||||
}
 | 
			
		||||
@@ -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
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user