123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- using System;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata;
- #nullable disable
- namespace OrderSystem.Entity
- {
- public partial class OrderSystemContext : DbContext
- {
- public OrderSystemContext()
- {
- }
- public OrderSystemContext(DbContextOptions<OrderSystemContext> options)
- : base(options)
- {
- }
- public virtual DbSet<CVxIdClientPhoneMerge> CVxIdClientPhoneMerge { get; set; }
- public virtual DbSet<VxClientinfo> VxClientinfo { get; set; }
- public virtual DbSet<VxContractInfo> VxContractInfo { get; set; }
- public virtual DbSet<VxOrderInfo> 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<CVxIdClientPhoneMerge>(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<VxClientinfo>(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<VxContractInfo>(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<VxOrderInfo>(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);
- }
- }
|