123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using EVCB_OCPP.Domain.Models.ConnectionLogDB;
- using Microsoft.EntityFrameworkCore;
- namespace EVCB_OCPP.Domain;
- public partial class ConnectionLogDBContext : DbContext
- {
- public ConnectionLogDBContext()
- {
- }
- public ConnectionLogDBContext(DbContextOptions<ConnectionLogDBContext> options)
- : base(options)
- {
- }
- public virtual DbSet<MachineConnectionLog> MachineConnectionLogs { 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 http://go.microsoft.com/fwlink/?LinkId=723263.
- // => optionsBuilder.UseSqlServer("data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_ConnectionLog;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<MachineConnectionLog>(entity =>
- {
- entity.HasKey(e => new { e.Id, e.CreatedOn });
- entity.ToTable("MachineConnectionLog");
- entity.Property(e => e.Id).ValueGeneratedOnAdd();
- entity.Property(e => e.CreatedOn).HasColumnType("datetime");
- entity.Property(e => e.ChargeBoxId).HasMaxLength(128);
- entity.Property(e => e.Data).HasMaxLength(3600);
- entity.Property(e => e.EvseendPoint)
- .HasMaxLength(25)
- .HasColumnName("EVSEEndPoint");
- entity.Property(e => e.MessageType).HasMaxLength(50);
- entity.Property(e => e.Msg).HasMaxLength(200);
- entity.Property(e => e.Session).HasMaxLength(36);
- });
- OnModelCreatingPartial(modelBuilder);
- }
- partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
- }
|