freetubesync/FreeTubeSync/Database/DataContext.cs
Mario Steele 72dca6c1fe Updated DataContext
Added DbSet for ChangeLog table.
2025-07-31 13:00:32 -05:00

30 lines
No EOL
948 B
C#

using FreeTubeSync.Model.Database;
using Microsoft.EntityFrameworkCore;
namespace FreeTubeSync.Database;
public class DataContext : DbContext
{
public DataContext(DbContextOptions<DataContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Profile>()
.Navigation(e => e.subscriptions).AutoInclude();
modelBuilder.Entity<Playlist>()
.Navigation(e => e.videos).AutoInclude();
}
public DbSet<History> Histories { get; set; }
public DbSet<Playlist> Playlists { get; set; }
public DbSet<Profile> Profiles { get; set; }
public DbSet<SearchHistory> SearchHistories { get; set; }
public DbSet<Setting> Settings { get; set; }
public DbSet<Subscription> Subscriptions { get; set; }
public DbSet<Video> Videos { get; set; }
public DbSet<ChangeLog> ChangeLogs { get; set; }
}