Implement BuCol
This commit is contained in:
		@@ -5,12 +5,12 @@ namespace StarsAssistant.Model;
 | 
			
		||||
 | 
			
		||||
public class Planet
 | 
			
		||||
{
 | 
			
		||||
    #region Persistant and derived propeties
 | 
			
		||||
    #region Persistant propeties
 | 
			
		||||
 | 
			
		||||
    [Key]
 | 
			
		||||
    public required string Name { get; set; }
 | 
			
		||||
 | 
			
		||||
    public string? OwnerId { get; set; }
 | 
			
		||||
    public string OwnerId { get; set; } = String.Empty;
 | 
			
		||||
    
 | 
			
		||||
    public string StarbaseType { get; set; } = String.Empty;
 | 
			
		||||
    
 | 
			
		||||
@@ -70,7 +70,7 @@ public class Planet
 | 
			
		||||
    
 | 
			
		||||
    public int? DriverWarp { get; set; }
 | 
			
		||||
    
 | 
			
		||||
    public string? RouteTarget { get; set; }
 | 
			
		||||
    public string RouteTarget { get; set; } = String.Empty;
 | 
			
		||||
    
 | 
			
		||||
    public int? GateRange { get; set; }
 | 
			
		||||
    
 | 
			
		||||
@@ -86,22 +86,4 @@ public class Planet
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
 | 
			
		||||
    #region Derived Properties
 | 
			
		||||
 | 
			
		||||
    // public int EffectiveValue() => EffectiveValue(Value);
 | 
			
		||||
 | 
			
		||||
    // public int MaxPopOnPlanet() => MaxPopOnPlanet(Value);
 | 
			
		||||
 | 
			
		||||
    // public int PopGrowth() => PopGrowth(Population ?? 0, MaxPopOnPlanet(), Value ?? 0);
 | 
			
		||||
 | 
			
		||||
    // public int MaxFact() => MaxFact(Population ?? 0);
 | 
			
		||||
 | 
			
		||||
    // public int MaxMines() => MaxMines(Population ?? 0);
 | 
			
		||||
 | 
			
		||||
    // public int ResourcesFromPop() => ResourcesFromPop(Population ?? 0, Value ?? 0);
 | 
			
		||||
 | 
			
		||||
    // public int ResourcesFromFact() => ResourcesFromFact(Population ?? 0, Factories ?? 0, Value ?? 0);
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -18,6 +18,15 @@ public class StarsDatabase(string DbPath) : DbContext
 | 
			
		||||
    protected override void OnConfiguring(DbContextOptionsBuilder options)
 | 
			
		||||
        => options.UseSqlite($"Data Source={DbPath}");
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Configure the model, force it to use property accessors we define.
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    /// <param name="modelBuilder">model builder</param>
 | 
			
		||||
    protected override void OnModelCreating(ModelBuilder modelBuilder)
 | 
			
		||||
    {
 | 
			
		||||
        modelBuilder.UsePropertyAccessMode(PropertyAccessMode.Property);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
 | 
			
		||||
    #region IStarsDatabase Implementation
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user