using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; namespace kuzminIVProjectWorkOnDemo.Models; public partial class KuzmintestprojContext : DbContext { public KuzmintestprojContext() { } public KuzmintestprojContext(DbContextOptions options) : base(options) { } public virtual DbSet Sevices { get; set; } public virtual DbSet Sevicesandclients { 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=kuzmintestproj;Username=31P;Password=12345"); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("sevices_pkey"); entity.ToTable("sevices"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Cost).HasColumnName("cost"); entity.Property(e => e.Discount).HasColumnName("discount"); entity.Property(e => e.Duration).HasColumnName("duration"); entity.Property(e => e.Image) .HasMaxLength(100) .IsFixedLength() .HasColumnName("image"); entity.Property(e => e.Title) .HasMaxLength(200) .IsFixedLength() .HasColumnName("title"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("sevicesandclient_pkey"); entity.ToTable("sevicesandclient"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Dateoflesson) .HasColumnType("timestamp without time zone") .HasColumnName("dateoflesson"); entity.Property(e => e.Idtitle).HasColumnName("idtitle"); entity.Property(e => e.Iduser).HasColumnName("iduser"); entity.HasOne(d => d.IdtitleNavigation).WithMany(p => p.Sevicesandclients) .HasForeignKey(d => d.Idtitle) .HasConstraintName("sevicesandclient_idtitle_fkey"); entity.HasOne(d => d.IduserNavigation).WithMany(p => p.Sevicesandclients) .HasForeignKey(d => d.Iduser) .HasConstraintName("sevicesandclient_iduser_fkey"); }); 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.Dor) .HasColumnType("timestamp without time zone") .HasColumnName("dor"); entity.Property(e => e.Email) .HasMaxLength(40) .IsFixedLength() .HasColumnName("email"); entity.Property(e => e.Fname) .HasMaxLength(30) .IsFixedLength() .HasColumnName("fname"); entity.Property(e => e.Gender) .HasMaxLength(1) .HasColumnName("gender"); entity.Property(e => e.Mname) .HasMaxLength(30) .IsFixedLength() .HasColumnName("mname"); entity.Property(e => e.Sname) .HasMaxLength(30) .IsFixedLength() .HasColumnName("sname"); entity.Property(e => e.Telnum) .HasMaxLength(50) .IsFixedLength() .HasColumnName("telnum"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }