using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; namespace AvaloniaTeachersDB.Models; public partial class _43pToropovaContext : DbContext { public _43pToropovaContext() { } public _43pToropovaContext(DbContextOptions<_43pToropovaContext> options) : base(options) { } public virtual DbSet Courses { get; set; } public virtual DbSet Genders { get; set; } public virtual DbSet SchoolSubjects { get; set; } public virtual DbSet Teachers { get; set; } public virtual DbSet TeacherCourses { get; set; } public virtual DbSet TeachersSubjects { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263. => optionsBuilder.UseNpgsql("Host=edu.pg.ngknn.local;Port=5432;Database=43P_Toropova;Username=43P;Password=444444"); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.IdCourses).HasName("courses_pk"); entity.ToTable("courses"); entity.Property(e => e.IdCourses) .UseIdentityAlwaysColumn() .HasColumnName("id_courses"); entity.Property(e => e.NameCourses) .HasColumnType("character varying") .HasColumnName("name_courses"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.IdGender).HasName("genders_pk"); entity.ToTable("genders"); entity.Property(e => e.IdGender) .UseIdentityAlwaysColumn() .HasColumnName("id_gender"); entity.Property(e => e.NameGender) .HasColumnType("character varying") .HasColumnName("name_gender"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.IdSubjects).HasName("school_subjects_pk"); entity.ToTable("school_subjects"); entity.Property(e => e.IdSubjects) .UseIdentityAlwaysColumn() .HasColumnName("id_subjects"); entity.Property(e => e.NameSubjects) .HasColumnType("character varying") .HasColumnName("name__subjects"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.IdTeachers).HasName("teachers_pk"); entity.ToTable("teachers"); entity.Property(e => e.IdTeachers) .UseIdentityAlwaysColumn() .HasColumnName("id_teachers"); entity.Property(e => e.BirthdayTeacher).HasColumnName("birthday_teacher"); entity.Property(e => e.ExperienceTeacher).HasColumnName("experience_teacher"); entity.Property(e => e.IdGender).HasColumnName("id_gender"); entity.Property(e => e.Mail) .HasColumnType("character varying") .HasColumnName("mail"); entity.Property(e => e.NameTeacher) .HasColumnType("character varying") .HasColumnName("name_teacher"); entity.Property(e => e.PatronymicTeacher) .HasColumnType("character varying") .HasColumnName("patronymic_teacher"); entity.Property(e => e.Phone) .HasColumnType("character varying") .HasColumnName("phone"); entity.Property(e => e.SurnameTeacher) .HasColumnType("character varying") .HasColumnName("surname_teacher"); entity.HasOne(d => d.IdGenderNavigation).WithMany(p => p.Teachers) .HasForeignKey(d => d.IdGender) .HasConstraintName("teachers_fk"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.IdTeacherCourse).HasName("teacher_courses_pk"); entity.ToTable("teacher_courses"); entity.Property(e => e.IdTeacherCourse) .UseIdentityAlwaysColumn() .HasColumnName("id_teacher_course"); entity.Property(e => e.IdCourse).HasColumnName("id_course"); entity.Property(e => e.IdTeacher).HasColumnName("id_teacher"); entity.Property(e => e.TimeHours).HasColumnName("time_hours"); entity.HasOne(d => d.IdCourseNavigation).WithMany(p => p.TeacherCourses) .HasForeignKey(d => d.IdCourse) .HasConstraintName("teacher_courses_fk"); entity.HasOne(d => d.IdTeacherNavigation).WithMany(p => p.TeacherCourses) .HasForeignKey(d => d.IdTeacher) .HasConstraintName("teacher_courses_fk_1"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.IdTeacherSubjects).HasName("teachers_subjects_pk"); entity.ToTable("teachers_subjects"); entity.Property(e => e.IdTeacherSubjects) .UseIdentityAlwaysColumn() .HasColumnName("id_teacher_subjects"); entity.Property(e => e.IdSubjects).HasColumnName("id_subjects"); entity.Property(e => e.IdTeacher).HasColumnName("id_teacher"); entity.HasOne(d => d.IdSubjectsNavigation).WithMany(p => p.TeachersSubjects) .HasForeignKey(d => d.IdSubjects) .HasConstraintName("teachers_subjects_fk_1"); entity.HasOne(d => d.IdTeacherNavigation).WithMany(p => p.TeachersSubjects) .HasForeignKey(d => d.IdTeacher) .HasConstraintName("teachers_subjects_fk"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }