using Domain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Infrastructure
{
    public class MyShipEntityTypeConfiguration : IEntityTypeConfiguration<MyShip> {
        public void Configure(EntityTypeBuilder<MyShip> builder)
        {
            builder.ToTable("FishParticular");

            builder.HasKey(x => x.ShipRegisterNoKey);

            builder.HasMany(s => s.ShipCertificate).WithOne(x => x.MyShip).HasForeignKey(s => s.shipRegisterNoKey);

            

            builder.Property(x => x.ShipRegisterNoKey).HasColumnName("ShipRegisterNoKey");
            builder.Property(x => x.ShipRegisterNo).HasColumnName("ShipRegisterNo");
            builder.Property(x => x.Tha_Name).HasColumnName("Tha_Name");
            builder.Property(x => x.Eng_Name).HasColumnName("Eng_Name");
            builder.Property(x => x.Use_type_key).HasColumnName("Use_type_key");
            builder.Property(x => x.Use_type_Name).HasColumnName("Use_type_Name");
            builder.Property(x => x.Use_bound_Name).HasColumnName("Use_bound_Name");
            builder.Property(x => x.TonGross).HasColumnName("TonGross");
            builder.Property(x => x.TonNet).HasColumnName("TonNet");
            builder.Property(x => x.Loa).HasColumnName("Loa");
            builder.Property(x => x.Beam).HasColumnName("Beam");
            builder.Property(x => x.Depth).HasColumnName("Depth");
            builder.Property(x => x.Registerdate).HasColumnName("Registerdate");
            builder.Property(x => x.RegisterProviceCode).HasColumnName("RegisterProviceCode");
            builder.Property(x => x.Permit_ValidDate).HasColumnName("Permit_ValidDate");
            builder.Property(x => x.Permit_ExpireDate).HasColumnName("Permit_ExpireDate");
            builder.Property(x => x.PicShip1).HasColumnName("PicShip1");
            builder.Property(x => x.PicShip2).HasColumnName("PicShip2");
            builder.Property(x => x.PicShip3).HasColumnName("PicShip3");
            builder.Property(x => x.visittype).HasColumnName("visittype");
            builder.Property(x => x.shipstatus).HasColumnName("shipstatus");
            builder.Property(x => x.totalseaman).HasColumnName("totalseaman");
            builder.Property(x => x.totallabour).HasColumnName("totallabour");
            builder.Property(x => x.totalcrewonboard).HasColumnName("totalcrewonboard");
            builder.Property(x => x.procurementtype).HasColumnName("procurementtype");
            builder.Property(x => x.approvestatus).HasColumnName("approvestatus");
            builder.Property(x => x.CreateDateTime).HasColumnName("CreateDateTime");
            builder.Property(x => x.CreateBy).HasColumnName("CreateBy");
            builder.Property(x => x.ModifyDateTime).HasColumnName("ModifyDateTime");
            builder.Property(x => x.ModifyBy).HasColumnName("ModifyBy");
            builder.Property(x => x.CallSign).HasColumnName("CallSign");

        }
    }
    
}
