PIbd-22_Karamushko_M_K_Univ.../University/DatabaseImplement/UniversityDatabase.cs

27 lines
1.3 KiB
C#
Raw Normal View History

2023-04-02 17:39:42 +04:00
using UniversityDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
2023-04-04 22:36:39 +04:00
namespace UniversityDatabaseImplement
2023-04-02 17:39:42 +04:00
{
2023-04-04 22:36:39 +04:00
public class UniversityDatabase : DbContext
2023-04-02 17:39:42 +04:00
{
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);
}
2023-04-04 22:36:39 +04:00
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; }
2023-04-02 17:39:42 +04:00
}
}