123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Collections.Generic;
- using Microsoft.EntityFrameworkCore;
- namespace kuzminIVProjectWorkOnDemo.Models;
- public partial class KuzmintestprojContext : DbContext
- {
- public KuzmintestprojContext()
- {
- }
- public KuzmintestprojContext(DbContextOptions<KuzmintestprojContext> options)
- : base(options)
- {
- }
- public virtual DbSet<Sevice> Sevices { get; set; }
- public virtual DbSet<Sevicesandclient> Sevicesandclients { get; set; }
- public virtual DbSet<User> 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<Sevice>(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<Sevicesandclient>(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<User>(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);
- }
|