34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
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; }
|
|
}
|
|
}
|