//using System; //using System.Collections.Generic; //using Microsoft.EntityFrameworkCore; //namespace AvaloniaHomeTry.Models; //public partial class AvaloniadbContext : DbContext //{ // public AvaloniadbContext() // { // } // public AvaloniadbContext(DbContextOptions options) // : base(options) // { // } // public virtual DbSet Genders { get; set; } // public virtual DbSet RolesTables { 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=localhost;Port=5432;Database=avaloniadb;Username=postgres;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.RoleName) // .HasMaxLength(20) // .HasColumnName("roleName"); // }); // modelBuilder.Entity(entity => // { // entity.HasKey(e => e.Id).HasName("users_pkey"); // entity.ToTable("userstables"); // entity.Property(e => e.Id) // .HasDefaultValueSql("nextval('users_id_seq'::regclass)") // .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.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_genderid_fkey"); // entity.HasOne(d => d.RoleNavigation).WithMany(p => p.UsersTables) // .HasForeignKey(d => d.IdRole) // .HasConstraintName("users_roleid_fkey"); // }); // OnModelCreatingPartial(modelBuilder); // } // partial void OnModelCreatingPartial(ModelBuilder modelBuilder); //}