using System; using System.Collections.Generic; using EVCB_OCPP.Domain.Models.MeterValueDb; using Microsoft.EntityFrameworkCore; namespace EVCB_OCPP.Domain; public partial class MeterValueDBContext : DbContext { public MeterValueDBContext() { } public MeterValueDBContext(DbContextOptions options) : base(options) { } // 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 http://go.microsoft.com/fwlink/?LinkId=723263. // => optionsBuilder.UseSqlServer("data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_MeterValue;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework"); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.UseCollation("Chinese_Taiwan_Stroke_CI_AS"); modelBuilder.Entity(entity => { entity .HasNoKey() .ToTable("ConnectorMeterValueRecord"); entity.Property(e => e.ChargeBoxId).HasMaxLength(50); entity.Property(e => e.CreatedOn).HasColumnType("smalldatetime"); entity.Property(e => e.Value).HasMaxLength(10); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }