2023-04-03 20:19:36 +04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using SchoolAgainStudyDataBaseImplements.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
2023-04-05 21:11:51 +04:00
|
|
|
|
using System.Reflection.Metadata;
|
2023-04-03 20:19:36 +04:00
|
|
|
|
using System.Runtime.ConstrainedExecution;
|
|
|
|
|
using System.Text;
|
2023-04-05 21:11:51 +04:00
|
|
|
|
using System.Threading.Tasks;
|
2023-04-03 20:19:36 +04:00
|
|
|
|
using Task = SchoolAgainStudyDataBaseImplements.Models.Task;
|
|
|
|
|
|
|
|
|
|
namespace SchoolAgainStudyDataBaseImplements
|
|
|
|
|
{
|
|
|
|
|
public class SchoolDataBase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2023-05-17 21:29:39 +04:00
|
|
|
|
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=SchoolAgainStudyDataBase;Username=postgres;Password=186qazwsx");
|
2023-04-03 20:19:36 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
2023-04-05 21:11:51 +04:00
|
|
|
|
|
2023-04-03 20:19:36 +04:00
|
|
|
|
public virtual DbSet<Student> Students { 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<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; }
|
|
|
|
|
|
|
|
|
|
}
|
2023-04-05 21:11:51 +04:00
|
|
|
|
}
|