using Company.Domain.FileEmployerAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace CompanyManagment.EFCore.Mapping; public class FileEmployerMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("FileEmployer"); builder.HasKey(x => x.id); builder.Property(x => x.FName).HasMaxLength(25); builder.Property(x => x.LName).HasMaxLength(25); builder.Property(x => x.RepresentativeFullName).HasMaxLength(50); builder.Property(x => x.LegalName).HasMaxLength(50); builder.Property(x => x.FullName).HasMaxLength(50); builder.Property(x => x.IdNumber).HasMaxLength(15); builder.Property(x => x.NationalCode).HasMaxLength(10); builder.Property(x => x.NationalId).HasMaxLength(10); builder.Property(x => x.RegisterId).HasMaxLength(10); builder.Property(x => x.Gender).HasMaxLength(10); builder.Property(x => x.MaritalStatus).HasMaxLength(10); builder.Property(x => x.LevelOfEducation).HasMaxLength(15); builder.Property(x => x.IsLegal).HasMaxLength(5); builder.Property(x => x.FieldOfStudy).HasMaxLength(100); builder.Property(x => x.InsuranceWorkshopCode).HasMaxLength(100); builder.Property(x => x.Phone).HasMaxLength(30); builder.Property(x => x.OfficePhone).HasMaxLength(30); builder.Property(x => x.MclsUserName).HasMaxLength(100); builder.Property(x => x.MclsPassword).HasMaxLength(100); builder.Property(x => x.EserviceUserName).HasMaxLength(100); builder.Property(x => x.EservicePassword).HasMaxLength(100); builder.Property(x => x.TaxOfficeUserName).HasMaxLength(100); builder.Property(x => x.TaxOfficepassword).HasMaxLength(100); builder.Property(x => x.SanaUserName).HasMaxLength(100); builder.Property(x => x.SanaPassword).HasMaxLength(100); builder.Property(x => x.IsActive).HasMaxLength(5); //child builder.HasOne(x => x.Representative) .WithMany(x => x.FileEmployerList) .HasForeignKey(x => x.RepresentativeId); } }