Files
gpw_next/GPW.Api/GPW.Data/DBModels/GPWContext.cs
T
2021-10-18 15:43:53 +02:00

64 lines
2.2 KiB
C#

using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
#nullable disable
namespace GPW.Data.DBModels
{
public partial class GPWContext : DbContext
{
public GPWContext()
{
}
public GPWContext(DbContextOptions<GPWContext> options)
: base(options)
{
}
public virtual DbSet<CheckVc19> CheckVc19s { 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=SQLSTEAM;Database=GPW;Trusted_Connection=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "Latin1_General_CI_AS");
modelBuilder.Entity<CheckVc19>(entity =>
{
entity.HasKey(e => e.IdxCheck)
.HasName("PK_CheckC19");
entity.ToTable("CheckVC19");
entity.Property(e => e.IdxCheck).ValueGeneratedNever();
entity.Property(e => e.DtCheck)
.HasColumnType("datetime")
.HasColumnName("dtCheck")
.HasDefaultValueSql("(getdate())");
entity.Property(e => e.IdxDipendente).HasColumnName("idxDipendente");
entity.Property(e => e.Payload)
.IsRequired()
.HasMaxLength(500)
.HasColumnName("payload")
.HasDefaultValueSql("('')");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
}