Files
Backend-Api/CompanyManagment.EFCore/Mapping/FileEmployerMapping.cs
2024-07-05 21:36:15 +03:30

45 lines
2.2 KiB
C#

using Company.Domain.FileEmployerAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class FileEmployerMapping : IEntityTypeConfiguration<FileEmployer>
{
public void Configure(EntityTypeBuilder<FileEmployer> 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);
}
}