Add sqlite database
This commit is contained in:
@@ -7,10 +7,16 @@ namespace EstusShots.Server.Services
|
||||
{
|
||||
public EstusShotsContext(DbContextOptions options) : base(options)
|
||||
{
|
||||
ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
||||
Database.EnsureCreated();
|
||||
}
|
||||
|
||||
public DbSet<Season> Seasons { get; set; } = default!;
|
||||
public DbSet<Episode> Episodes { get; set; } = default!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Season>().ToTable(nameof(Season));
|
||||
modelBuilder.Entity<Episode>().ToTable(nameof(Episode));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user