Files
CouchLog/WatchLog/Data/WatchLogDataContext.cs

47 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore;
namespace WatchLog.Data
{
public class WatchLogDataContext : DbContext
{
protected readonly IConfiguration Configuration;
public WatchLogDataContext(IConfiguration configuration)
{
Configuration = configuration;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite(Configuration.GetConnectionString("WatchLogDB"));
}
//Note: Link Tables a commented out because Entity Framework creates the tables by itself
// Global
public DbSet<Admin> Admins { get; set; }
public DbSet<Genre> Genres { get; set; }
public DbSet<GlobalEntity> GlobalEntities { get; set; }
//public DbSet<LinkTableGlobalGenre> LinkTableGlobalGenres { get; set; }
public DbSet<StreamingPlatform> StreamingPlatforms { get; set; }
public DbSet<Type> Types { get; set; } // 'Watchlog.Data.Type' if namecolsion with System.Type
public DbSet<User> Users { get; set; }
//Private
public DbSet<Label> Labels { get; set; }
//public DbSet<LinkTablePrivateLabel> LinkTablePrivateLabels { get; set; }
//public DbSet<LinkTablePrivateStreamingPlatform> LinkTablePrivateStreamingPlatform { get; set; }
public DbSet<PrivateEntity> PrivateEntities { get; set; }
public DbSet<UserWatchStatus> UserWatchStatuses { get; set; }
//Shared
//public DbSet<LinkTableSharedLabel> LinkTableSharedLabels { get; set; }
//public DbSet<LinkTableSharedStreamingPlatform> LinkTableSharedStreamingPlatforms { get; set; }
//public DbSet<LinkTableSharedUser> LinkTableSharedUsers { get; set; }
public DbSet<SharedList> SharedLists { get; set; }
public DbSet<SharedListEntity> SharedListEntities { get; set; }
public DbSet<SharedListLabel> SharedListLabels { get; set; }
public DbSet<SharedWatchStatus> SharedWatchStatuses { get; set; }
}
}