username@email.com
2021-12-22 6b14f6fdebc6bb3cb99aea0c0848ddfad0e30633
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
 
#nullable disable
 
namespace zhengcaioa.Models
{
    public partial class zcUserInfoN_dbContext : DbContext
    {
        public zcUserInfoN_dbContext()
        {
        }
 
        public zcUserInfoN_dbContext(DbContextOptions<zcUserInfoN_dbContext> options)
            : base(options)
        {
        }
 
        public virtual DbSet<GadeRole> GadeRoles { get; set; }
        public virtual DbSet<UsergGadeRole> UsergGadeRoles { 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=.;Initial Catalog=zcUserInfoN_db;User ID=sa;Password=123456");
            }
        }
 
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS");
 
            modelBuilder.Entity<GadeRole>(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<UsergGadeRole>(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);
            });
 
            OnModelCreatingPartial(modelBuilder);
        }
 
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}