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-08 17:38:34 +04:00
|
|
|
|
public virtual DbSet<User> Users { set; get; }
|
2023-04-09 00:45:19 +04:00
|
|
|
|
public virtual DbSet<UserStudent> UserStudents { set; get; }
|
2023-04-02 17:39:42 +04:00
|
|
|
|
}
|
|
|
|
|
}
|