using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; #nullable disable namespace zhengcaioa.Models { public partial class zcUserInfoN_dbContext : DbContext { public zcUserInfoN_dbContext() { this.Database.SetCommandTimeout(60); } public zcUserInfoN_dbContext(DbContextOptions options) : base(options) { } public virtual DbSet GadeRoles { get; set; } public virtual DbSet UsergGadeRoles { get; set; } public virtual DbSet FrameworkUsers { get; set; } public virtual DbSet FrameworkRoles { get; set; } public virtual DbSet OderOfVips { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) { #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.UseSqlServer("Data Source=172.26.97.147;Initial Catalog=zcUserInfoN_db;User ID=sa;Password=Za20222812"); } } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS"); modelBuilder.Entity(entity => { entity.ToTable("gadeRoles"); entity.HasIndex(e => e.FrameworkRoleId, "IX_gadeRoles_FrameworkRoleId"); entity.Property(e => e.Id) .ValueGeneratedNever() .HasColumnName("ID"); entity.Property(e => e.CreateBy).HasMaxLength(50); entity.Property(e => e.OnShelf).HasColumnName("onShelf"); entity.Property(e => e.Price) .HasColumnType("decimal(18, 2)") .HasColumnName("price"); entity.Property(e => e.UpdateBy).HasMaxLength(50); entity.Property(e => e.XiaoCaiQandA).HasColumnName("XiaoCaiQAndA"); entity.Property(e => e.XiaocaiKeTang).HasColumnName("xiaocaiKeTang"); }); modelBuilder.Entity(entity => { entity.ToTable("usergGadeRoles"); entity.HasIndex(e => e.SecondUserGadeRolesId, "IX_usergGadeRoles_SecondUserGadeRolesId"); entity.HasIndex(e => e.UserGadeRolesId, "IX_usergGadeRoles_UserGadeRolesId"); entity.HasIndex(e => e.UserId, "IX_usergGadeRoles_UserId"); entity.Property(e => e.Id) .ValueGeneratedNever() .HasColumnName("ID"); entity.Property(e => e.CreateBy).HasMaxLength(50); entity.Property(e => e.UpdateBy).HasMaxLength(50); entity.HasOne(d => d.SecondUserGadeRoles) .WithMany(p => p.UsergGadeRoleSecondUserGadeRoles) .HasForeignKey(d => d.SecondUserGadeRolesId); entity.HasOne(d => d.UserGadeRoles) .WithMany(p => p.UsergGadeRoleUserGadeRoles) .HasForeignKey(d => d.UserGadeRolesId); }); modelBuilder.Entity(entity => { entity.HasIndex(e => e.PhotoId, "IX_FrameworkUsers_PhotoId"); entity.Property(e => e.Id) .ValueGeneratedNever() .HasColumnName("ID"); entity.Property(e => e.Address).HasMaxLength(200); entity.Property(e => e.Agent).HasComment("是否时代理商?0 为普通客户 1为代理商"); entity.Property(e => e.CreateBy).HasMaxLength(50); entity.Property(e => e.Email).HasMaxLength(50); entity.Property(e => e.HomePhone).HasMaxLength(30); entity.Property(e => e.Itcode) .IsRequired() .HasMaxLength(50) .HasColumnName("ITCode"); entity.Property(e => e.Name) .IsRequired() .HasMaxLength(50); entity.Property(e => e.Password) .IsRequired() .HasMaxLength(32); entity.Property(e => e.UpdateBy).HasMaxLength(50); entity.Property(e => e.WxOpenid).HasMaxLength(50); }); modelBuilder.Entity(entity => { entity.Property(e => e.Id) .ValueGeneratedNever() .HasColumnName("ID"); entity.Property(e => e.CreateBy).HasMaxLength(50); entity.Property(e => e.RoleCode).HasMaxLength(100); entity.Property(e => e.RoleName) .IsRequired() .HasMaxLength(50); entity.Property(e => e.UpdateBy).HasMaxLength(50); }); modelBuilder.Entity(entity => { entity.ToTable("oderOfVIPs"); entity.Property(e => e.Id) .ValueGeneratedNever() .HasColumnName("ID"); entity.Property(e => e.Amout).HasColumnType("decimal(18, 2)"); entity.Property(e => e.CreateBy).HasMaxLength(50); entity.Property(e => e.IsPayEnd).HasColumnName("isPayEND"); entity.Property(e => e.PayId).HasColumnName("PayID"); entity.Property(e => e.PayMoney).HasColumnType("decimal(18, 2)"); entity.Property(e => e.Paytype).HasColumnName("paytype"); entity.Property(e => e.RoleId).HasColumnName("RoleID"); entity.Property(e => e.UpdateBy).HasMaxLength(50); entity.Property(e => e.UserId).HasColumnName("UserID"); entity.Property(e => e.ViPrenewType).HasColumnName("viPrenewType"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); } }