Files
EstusShots-Net/EstusShots.Server/Services/EstusShotsContext.cs
2020-02-29 18:45:10 +01:00

22 lines
663 B
C#

using EstusShots.Server.Models;
using Microsoft.EntityFrameworkCore;
namespace EstusShots.Server.Services
{
public class EstusShotsContext : DbContext
{
public EstusShotsContext(DbContextOptions options) : base(options)
{
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));
}
}
}