2024-04-18 20:20:50 +04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using UniversityDatabaseImplement.Models;
|
|
|
|
|
|
|
|
|
|
namespace UniversityDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class UniversityDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder
|
|
|
|
|
optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-05-02 17:22:43 +04:00
|
|
|
|
//Возможно понадобится писать вместо (localdb) название пк, вот пк Егора: DESKTOP-N8BRIPR; other-name: LAPTOP-DYCTATOR; other-name: DyCTaTOR
|
2024-05-27 23:18:20 +04:00
|
|
|
|
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-N8BRIPR\SQLEXPRESS;Initial Catalog=UniversityDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
2024-04-18 20:20:50 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
public virtual DbSet<Student> Students { set; get; }
|
2024-04-24 14:08:27 +04:00
|
|
|
|
public virtual DbSet<PlanOfStudy> PlanOfStudys { set; get; }
|
2024-04-18 20:20:50 +04:00
|
|
|
|
public virtual DbSet<Attestation> Attestations { set; get; }
|
2024-04-29 15:37:19 +04:00
|
|
|
|
public virtual DbSet<User> Users { set; get; }
|
2024-04-19 19:30:16 +04:00
|
|
|
|
public virtual DbSet<Teacher> Teachers { set; get; }
|
|
|
|
|
public virtual DbSet<Discipline> Disciplines { set; get; }
|
|
|
|
|
public virtual DbSet<Statement> Statements { set; get; }
|
2024-04-23 23:03:32 +04:00
|
|
|
|
public virtual DbSet<StudentDiscipline> StudentDisciplines { set; get; }
|
2024-04-24 14:08:27 +04:00
|
|
|
|
public virtual DbSet<PlanOfStudyTeacher> PlanOfStudyTeachers { set; get; }
|
2024-04-18 20:20:50 +04:00
|
|
|
|
}
|
|
|
|
|
}
|