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

44 lines
1.9 KiB
C#

using Company.Domain.FileEmployeeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class FileEmployeeMapping : IEntityTypeConfiguration<FileEmployee>
{
public void Configure(EntityTypeBuilder<FileEmployee> builder)
{
builder.ToTable("FileEmployee");
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.FatherName).HasMaxLength(25);
builder.Property(x => x.NationalCode).HasMaxLength(10);
builder.Property(x => x.IdNumber).HasMaxLength(15);
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.FieldOfStudy).HasMaxLength(100);
builder.Property(x => x.InsuranceCode).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.FileEmployeeList)
.HasForeignKey(x => x.RepresentativeId);
}
}