SUBD_SchoolSchedule/SchoolSchedule/SchoolScheduleDataBaseImplement/SchoolScheduleDataBase.cs
2024-04-08 14:40:49 +04:00

32 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SchoolScheduleDataBaseImplement.Models;
namespace SchoolScheduleDataBaseImplement
{
public class SchoolScheduleDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=SchoolScheduleDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Grade> Grades { set; get; }
public virtual DbSet<Lesson> Lessons { set; get; }
public virtual DbSet<LessonStudent> LessonStudents { set; get; }
public virtual DbSet<SchedulePlace> SchedulePlaces { set; get; }
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<Subject> Subjects { set; get; }
public virtual DbSet<Teacher> Teachers { set; get; }
}
}