using Microsoft.EntityFrameworkCore; using PSTW_CentralSystem.Models; // Add this to use the MarineTarball class namespace PSTW_CentralSystem.DBContext { public class MMSSystemContext : DbContext { public MMSSystemContext(DbContextOptions options) : base(options) { } // DbSet for tbl_marine_tarball public DbSet MarineTarballs { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // Map MarineTarball to tbl_marine_tarball modelBuilder.Entity().ToTable("tbl_marine_tarball"); // Configure properties if needed modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); // Primary key entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.ReportID).HasColumnName("reportID").HasMaxLength(50); entity.Property(e => e.FirstSampler).HasColumnName("firstSampler").HasMaxLength(50); entity.Property(e => e.SecondSampler).HasColumnName("secondSampler").HasMaxLength(50); entity.Property(e => e.DateSample).HasColumnName("dateSample"); entity.Property(e => e.TimeSample).HasColumnName("timeSample"); entity.Property(e => e.StationID).HasColumnName("stationID").HasMaxLength(20); entity.Property(e => e.ClassifyID).HasColumnName("classifyID").HasMaxLength(20); entity.Property(e => e.Latitude).HasColumnName("latitude"); entity.Property(e => e.Longitude).HasColumnName("longitude"); entity.Property(e => e.GetLatitude).HasColumnName("getLatitude"); entity.Property(e => e.GetLongitude).HasColumnName("getLongitude"); entity.Property(e => e.Timestamp).HasColumnName("timestamp"); }); } } }