2024-07-19 17:08:37 +00:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Numerics;
|
|
|
|
|
|
2024-07-23 18:20:01 +00:00
|
|
|
|
namespace net.nehmer.sa.Model;
|
2024-07-19 17:08:37 +00:00
|
|
|
|
|
|
|
|
|
public class StarsDatabase(string DbPath) : DbContext
|
|
|
|
|
{
|
|
|
|
|
#region Configuration and Construction
|
|
|
|
|
|
|
|
|
|
public string DbPath { get; } = DbPath;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Configure for SQLite and set the DB Path given.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">Options to update</param>
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
|
|
|
|
=> options.UseSqlite($"Data Source={DbPath}");
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Entities
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// List of all Planets read.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DbSet<Planet> Planets { get; set; }
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|