Files
SystemX.Web/Projects/VPKI/VPKI/VPKI.Library.DB/DB/VPKI_DataDB/Context/VpkiDataDbContext.cs
2025-04-24 15:42:47 +09:00

163 lines
6.1 KiB
C#

using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace DB.VPKI_DataDB;
public partial class VpkiDataDbContext : DbContext
{
public VpkiDataDbContext()
{
}
public VpkiDataDbContext(DbContextOptions<VpkiDataDbContext> options)
: base(options)
{
}
public virtual DbSet<TCertificate> TCertificates { get; set; }
public virtual DbSet<TOcsp> TOcsps { get; set; }
public virtual DbSet<TTbscsr> TTbscsrs { get; set; }
public virtual DbSet<TVerifyResult> TVerifyResults { 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.UseSqlServer("server=127.0.0.1; user id=VPKI; password=Kefico!@34; database=VPKI_DataDB; TrustServerCertificate=true;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<TCertificate>(entity =>
{
entity.HasKey(e => e.CCuid).HasName("PK__tCertifi__2AA00D94B11718A8");
entity.ToTable("tCertificate");
entity.Property(e => e.CCuid)
.ValueGeneratedNever()
.HasColumnName("cCuid");
entity.Property(e => e.CBrandCode)
.HasMaxLength(20)
.HasColumnName("cBrandCode");
entity.Property(e => e.CCert)
.HasMaxLength(2048)
.HasColumnName("cCert");
entity.Property(e => e.CCsr)
.HasMaxLength(2048)
.HasColumnName("cCsr");
entity.Property(e => e.CCsrsignature)
.HasMaxLength(1024)
.HasColumnName("cCsrsignature");
entity.Property(e => e.CDateTime).HasColumnName("cDateTime");
entity.Property(e => e.CIssueCount).HasColumnName("cIssueCount");
entity.Property(e => e.CLocalCode)
.HasMaxLength(20)
.HasColumnName("cLocalCode");
entity.Property(e => e.CMessage)
.HasMaxLength(250)
.HasColumnName("cMessage");
entity.Property(e => e.CTierCode)
.HasMaxLength(20)
.HasColumnName("cTierCode");
entity.Property(e => e.CUnitCode)
.HasMaxLength(20)
.HasColumnName("cUnitCode");
entity.Property(e => e.CVehicleCode)
.HasMaxLength(20)
.HasColumnName("cVehicleCode");
});
modelBuilder.Entity<TOcsp>(entity =>
{
entity.HasKey(e => e.CCuid).HasName("PK__tOcsp__2AA00D941E2BA200");
entity.ToTable("tOcsp");
entity.Property(e => e.CCuid)
.ValueGeneratedNever()
.HasColumnName("cCuid");
entity.Property(e => e.CDateTime).HasColumnName("cDateTime");
entity.Property(e => e.COcsp).HasColumnName("cOcsp");
entity.Property(e => e.CStatus)
.HasMaxLength(20)
.HasColumnName("cStatus");
entity.Property(e => e.CVerify)
.HasMaxLength(20)
.HasColumnName("cVerify");
});
modelBuilder.Entity<TTbscsr>(entity =>
{
entity.HasKey(e => e.CCuid).HasName("PK__tTbscsr__2AA00D94155F4FC3");
entity.ToTable("tTbscsr");
entity.Property(e => e.CCuid).HasColumnName("cCuid");
entity.Property(e => e.CCertType)
.HasMaxLength(20)
.HasColumnName("cCertType");
entity.Property(e => e.CDateTime).HasColumnName("cDateTime");
entity.Property(e => e.CDc)
.HasMaxLength(20)
.HasColumnName("cDc");
entity.Property(e => e.CDn)
.HasMaxLength(250)
.HasColumnName("cDn");
entity.Property(e => e.CHashedTbscsr)
.HasMaxLength(1024)
.HasColumnName("cHashedTbscsr");
entity.Property(e => e.CIdType)
.HasMaxLength(10)
.HasColumnName("cIdType");
entity.Property(e => e.CIftid)
.HasMaxLength(100)
.HasColumnName("cIftid");
entity.Property(e => e.CMacaddr)
.HasMaxLength(100)
.HasColumnName("cMacaddr");
entity.Property(e => e.COriginTbscsr)
.HasMaxLength(4000)
.HasColumnName("cOriginTbscsr");
entity.Property(e => e.CPcid)
.HasMaxLength(50)
.HasColumnName("cPcid");
entity.Property(e => e.CPublickey)
.HasMaxLength(1024)
.HasColumnName("cPublickey");
entity.Property(e => e.CSupplierId)
.HasMaxLength(10)
.HasColumnName("cSupplierId");
entity.Property(e => e.CTierCode)
.HasMaxLength(20)
.HasColumnName("cTierCode");
entity.Property(e => e.CUnitCode)
.HasMaxLength(20)
.HasColumnName("cUnitCode");
entity.Property(e => e.CWmi)
.HasMaxLength(20)
.HasColumnName("cWmi");
});
modelBuilder.Entity<TVerifyResult>(entity =>
{
entity.HasKey(e => e.CCuid).HasName("PK__tVerifyR__2AA00D94A7EE4DE6");
entity.ToTable("tVerifyResult");
entity.Property(e => e.CCuid)
.ValueGeneratedNever()
.HasColumnName("cCuid");
entity.Property(e => e.CResult)
.HasMaxLength(20)
.IsFixedLength()
.HasColumnName("cResult");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}