using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; #nullable disable namespace OrderSystem.Entity { public partial class OrderSystemContext : DbContext { public OrderSystemContext() { } public OrderSystemContext(DbContextOptions options) : base(options) { } public virtual DbSet CVxIdClientPhoneMerge { get; set; } public virtual DbSet VxClientinfo { get; set; } public virtual DbSet VxContractInfo { get; set; } public virtual DbSet VxOrderInfo { 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("Server=mes.saierdt.com;User Id=vxRead;Password=123123;Database=LSProduct"); } } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS"); modelBuilder.Entity(entity => { entity.HasNoKey(); entity.ToTable("C_VxIdClientPhoneMerge"); entity.Property(e => e.ClientName) .HasMaxLength(100) .IsUnicode(false); entity.Property(e => e.ClientPhoneNo) .IsRequired() .HasMaxLength(100) .IsUnicode(false); entity.Property(e => e.ContractNo) .IsRequired() .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.VxId) .IsRequired() .HasMaxLength(200) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasNoKey(); entity.ToView("vx_Clientinfo"); entity.Property(e => e.合同号) .IsRequired() .HasMaxLength(50); entity.Property(e => e.客户号码).HasMaxLength(50); entity.Property(e => e.客户名称).HasMaxLength(100); }); modelBuilder.Entity(entity => { entity.HasNoKey(); entity.ToView("vx_ContractInfo"); entity.Property(e => e.合同号) .IsRequired() .HasMaxLength(50); entity.Property(e => e.客户号码).HasMaxLength(50); entity.Property(e => e.客户名称).HasMaxLength(100); entity.Property(e => e.订单状态) .IsRequired() .HasMaxLength(8) .IsUnicode(false); }); modelBuilder.Entity(entity => { entity.HasNoKey(); entity.ToView("vx_OrderInfo"); entity.Property(e => e.产品).HasMaxLength(50); entity.Property(e => e.合同号) .IsRequired() .HasMaxLength(50); entity.Property(e => e.客户号码).HasMaxLength(50); entity.Property(e => e.客户名称).HasMaxLength(100); entity.Property(e => e.订单号) .IsRequired() .HasMaxLength(50); entity.Property(e => e.订单状态) .IsRequired() .HasMaxLength(8) .IsUnicode(false); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); } }