PIbd-22_Karamushko_M_K_Univ.../University/DatabaseImplement/UniversityDatabase.cs
2023-04-04 22:36:39 +04:00

27 lines
1.3 KiB
C#

using UniversityDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace UniversityDatabaseImplement
{
public class UniversityDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=UniversityDatabase;Username=postgres;Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Activity> Activities { set; get; }
public virtual DbSet<Discipline> Disciplines { set; get; }
public virtual DbSet<ExaminationResult> ExaminationResults { set; get; }
public virtual DbSet<ReportType> ReportTypes { set; get; }
public virtual DbSet<ReportTypeActivity> ReportTypeActivities { set; get; }
public virtual DbSet<ReportTypeDiscipline> ReportTypeDisciplines { set; get; }
public virtual DbSet<Statement> Statements { set; get; }
public virtual DbSet<StatementStudent> StatementStudents { set; get; }
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<StudentExaminationResult> StudentExaminationResults { set; get; }
}
}