using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; namespace AvaloniaHomeTry.Models; public partial class Bolshakov41pContext : DbContext { public Bolshakov41pContext() { } public Bolshakov41pContext(DbContextOptions options) : base(options) { } public virtual DbSet Genders { get; set; } public virtual DbSet RolesTables { get; set; } public virtual DbSet Traits { get; set; } public virtual DbSet UsersTable { 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=bolshakov41p;Username=31P;Password=12345"); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("genders_pkey"); entity.ToTable("genders"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.GenderName) .HasMaxLength(7) .HasColumnName("genderName"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("roles_table_pkey"); entity.ToTable("roles_table"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Role) .HasMaxLength(20) .HasColumnName("role"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Idtraits).HasName("traits_pkey"); entity.ToTable("traits"); entity.Property(e => e.Idtraits).HasColumnName("idtraits"); entity.Property(e => e.Titletraits).HasColumnName("titletraits"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("users_table_pkey"); entity.ToTable("users_table"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Dataofbirth) .HasColumnType("timestamp without time zone") .HasColumnName("dataofbirth"); entity.Property(e => e.Firstname) .HasMaxLength(30) .HasColumnName("firstname"); entity.Property(e => e.IdGender).HasColumnName("genderid"); entity.Property(e => e.Image).HasColumnName("image"); entity.Property(e => e.Login) .HasMaxLength(30) .HasColumnName("login"); entity.Property(e => e.Password) .HasMaxLength(30) .HasColumnName("password"); entity.Property(e => e.Patronymic) .HasMaxLength(30) .HasColumnName("patronymic"); entity.Property(e => e.IdRole).HasColumnName("roleid"); entity.Property(e => e.Surname) .HasMaxLength(30) .HasColumnName("surname"); entity.HasOne(d => d.GenderNavigation).WithMany(p => p.UsersTables) .HasForeignKey(d => d.IdGender) .HasConstraintName("users_table_genderid_fkey"); entity.HasOne(d => d.RoleNavigation).WithMany(p => p.UsersTables) .HasForeignKey(d => d.IdRole) .HasConstraintName("users_table_roleid_fkey"); entity.HasMany(d => d.IdTraits).WithMany(p => p.Idusers) .UsingEntity>( "Usersandtrait", r => r.HasOne().WithMany() .HasForeignKey("Idtraits") .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("usersandtraits_idtraits_fkey"), l => l.HasOne().WithMany() .HasForeignKey("Iduser") .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("usersandtraits_iduser_fkey"), j => { j.HasKey("Iduser", "Idtraits").HasName("usersandtraits_pkey"); j.ToTable("usersandtraits"); j.IndexerProperty("Iduser").HasColumnName("iduser"); j.IndexerProperty("Idtraits").HasColumnName("idtraits"); }); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }