ISEbd-22_CourseWork_School/School/SchoolDataBaseImplement/SchoolDB.cs

34 lines
1.2 KiB
C#
Raw Normal View History

2024-05-01 17:54:58 +04:00
using SchoolDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System.IO;
namespace SchoolDatabaseImplement
{
public class SchoolDB : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"
Host=localhost;
Port=5432;
Database=University;
Username=postgres;
Password=1234;
Include Error Detail=true");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Implementer> Implementers { set; get; }
public virtual DbSet<Requirement> Requirements { set; get; }
public virtual DbSet<RequirementByDiscipline> RequirementByDisciplines { set; get; }
public virtual DbSet<Executor> Executors { set; get; }
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<StudentByDiscipline> StudentsByDisciplines { set; get; }
public virtual DbSet<Account> Accounts { set; get; }
public virtual DbSet<Discipline> Disciplines { set; get; }
}
}