forked from DavidMakarov/StudentEnrollment
26 lines
924 B
C#
26 lines
924 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using StudentEnrollmentDatabaseImplement.Models;
|
|
|
|
namespace StudentEnrollmentDatabaseImplement
|
|
{
|
|
public class StudentEnrollmentDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseNpgsql(@"Host=192.168.56.103;Database=postgres;Username=postgres;Password=postgres");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
|
AppContext.SetSwitch("Npgsql.DisableDataTimeInfinityConversions", true);
|
|
}
|
|
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; }
|
|
|
|
}
|
|
}
|