48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using SchoolAgainStudyDataBaseImplements.Models;
|
|
using SchoolAgainStudyDataModels.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.ConstrainedExecution;
|
|
using System.Text;
|
|
using Task = SchoolAgainStudyDataBaseImplements.Models.Task;
|
|
|
|
namespace SchoolAgainStudyDataBaseImplements
|
|
{
|
|
public class SchoolDataBase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseNpgsql("Server=PostgreSQL;Host=localhost;Port=5432;Database=SchoolAgainStudyDataBase;Username=postgres;Password=postgres");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
|
|
public virtual DbSet<Student> Students { set; get; }
|
|
|
|
public virtual DbSet<StudentInterest> StudentInterests { set; get; }
|
|
|
|
public virtual DbSet<Interest> Interests { set; get; }
|
|
|
|
public virtual DbSet<Diy> Diys { set; get; }
|
|
public virtual DbSet<DiyInterest> DiyInterests { set; get; }
|
|
public virtual DbSet<Product> Products { set; get; }
|
|
public virtual DbSet<ProductInterest> ProductInterests { set; get; }
|
|
|
|
public virtual DbSet<Teacher> Teachers { set; get; }
|
|
|
|
public virtual DbSet<TeacherMaterial> TeacherMaterials { set; get; }
|
|
|
|
public virtual DbSet<Material> Materials { set; get; }
|
|
|
|
public virtual DbSet<Lesson> Lessons { set; get; }
|
|
public virtual DbSet<LessonMaterial> LessonMaterials { set; get; }
|
|
public virtual DbSet<Task> Tasks { set; get; }
|
|
public virtual DbSet<TaskMaterial> TaskMaterials { set; get; }
|
|
|
|
}
|
|
} |