using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; namespace WebApplicationAvaloniaForMe.Models; public partial class KuzminivpostgrContext : DbContext { public KuzminivpostgrContext() { } public KuzminivpostgrContext(DbContextOptions options) : base(options) { } public virtual DbSet Genders { get; set; } public virtual DbSet Mycharacters { get; set; } public virtual DbSet Properties { get; set; } public virtual DbSet Roles { get; set; } public virtual DbSet Users { 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 https://go.microsoft.com/fwlink/?LinkId=723263. => optionsBuilder.UseNpgsql("Host=edu.pg.ngknn.local;Port=5432;Database=kuzminivpostgr;Username=31P;Password=12345"); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("gender_pkey"); entity.ToTable("gender"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Title) .HasMaxLength(7) .HasColumnName("title"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("mycharacters_pkey"); entity.ToTable("mycharacters"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Dob) .HasColumnType("timestamp without time zone") .HasColumnName("dob"); entity.Property(e => e.Gender).HasColumnName("gender"); entity.Property(e => e.Imageprof).HasColumnName("imageprof"); entity.Property(e => e.Sname) .HasMaxLength(30) .HasColumnName("sname"); entity.HasOne(d => d.GenderNavigation).WithMany(p => p.Mycharacters) .HasForeignKey(d => d.Gender) .HasConstraintName("mycharacters_gender_fkey"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("property_pkey"); entity.ToTable("property"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Propertyname) .HasMaxLength(30) .HasColumnName("propertyname"); entity.HasMany(d => d.Mycharacters).WithMany(p => p.Properties) .UsingEntity>( "Charactersproperty", r => r.HasOne().WithMany() .HasForeignKey("Mycharacterid") .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("charactersproperty_mycharacterid_fkey"), l => l.HasOne().WithMany() .HasForeignKey("Propertyid") .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("charactersproperty_propertyid_fkey"), j => { j.HasKey("Propertyid", "Mycharacterid").HasName("charactersproperty_pkey"); j.ToTable("charactersproperty"); j.IndexerProperty("Propertyid").HasColumnName("propertyid"); j.IndexerProperty("Mycharacterid").HasColumnName("mycharacterid"); }); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("roles_pkey"); entity.ToTable("roles"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Rolename) .HasMaxLength(30) .HasColumnName("rolename"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("users_pkey"); entity.ToTable("users"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Dob) .HasColumnType("timestamp without time zone") .HasColumnName("dob"); entity.Property(e => e.Fname) .HasMaxLength(30) .HasColumnName("fname"); entity.Property(e => e.Gender).HasColumnName("gender"); entity.Property(e => e.Idroles).HasColumnName("idroles"); entity.Property(e => e.Lname) .HasMaxLength(30) .HasColumnName("lname"); entity.Property(e => e.Login) .HasMaxLength(30) .HasColumnName("login"); entity.Property(e => e.Passwords) .HasMaxLength(30) .HasColumnName("passwords"); entity.Property(e => e.Sname) .HasMaxLength(30) .HasColumnName("sname"); entity.HasOne(d => d.GenderNavigation).WithMany(p => p.Users) .HasForeignKey(d => d.Gender) .HasConstraintName("users_gender_fkey"); entity.HasOne(d => d.IdrolesNavigation).WithMany(p => p.Users) .HasForeignKey(d => d.Idroles) .HasConstraintName("users_idroles_fkey"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }