CourseWork/University/UniversityDatabaseImplement/UniversityDatabase.cs
2024-05-30 03:38:21 +04:00

29 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.EntityFrameworkCore;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement
{
public class UniversityDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
//Возможно понадобится писать вместо (localdb) название пк, вот пк Егора: DESKTOP-N8BRIPR; other-name: LAPTOP-DYCTATOR; other-name: DyCTaTOR
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-DYCTATOR\SQLEXPRESS;Initial Catalog=UniversityDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<PlanOfStudy> PlanOfStudys { set; get; }
public virtual DbSet<Attestation> Attestations { set; get; }
public virtual DbSet<User> Users { set; get; }
public virtual DbSet<Teacher> Teachers { set; get; }
public virtual DbSet<Discipline> Disciplines { set; get; }
public virtual DbSet<Statement> Statements { set; get; }
public virtual DbSet<StudentDiscipline> StudentDisciplines { set; get; }
public virtual DbSet<PlanOfStudyTeacher> PlanOfStudyTeachers { set; get; }
}
}