2024-04-16 22:57:41 +04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using StudentEnrollmentDatabaseImplement.Models;
|
|
|
|
|
|
|
|
|
|
namespace StudentEnrollmentDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class StudentEnrollmentDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-05-06 20:26:16 +04:00
|
|
|
|
optionsBuilder.UseNpgsql(@"Host=192.168.56.103;Database=postgres;Username=postgres;Password=postgres");
|
2024-04-16 22:57:41 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
|
|
|
|
AppContext.SetSwitch("Npgsql.DisableDataTimeInfinityConversions", true);
|
|
|
|
|
}
|
2024-05-06 20:26:16 +04:00
|
|
|
|
public virtual DbSet<Faculty> faculty { get; set; }
|
|
|
|
|
public virtual DbSet<Course> course { get; set; }
|
|
|
|
|
public virtual DbSet<Student> student { get; set; }
|
|
|
|
|
public virtual DbSet<StudentCourse> student_course { get; set; }
|
|
|
|
|
public virtual DbSet<ExamPoints> exampoints { get; set; }
|
2024-04-16 22:57:41 +04:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|