Files
Backend-Api/CompanyManagment.EFCore/Mapping/EmployeeBankInformationMapping.cs
2025-01-20 17:31:03 +03:30

23 lines
727 B
C#

using Company.Domain.EmployeeBankInformationAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping
{
public class EmployeeBankInformationMapping:IEntityTypeConfiguration<EmployeeBankInformation>
{
public void Configure(EntityTypeBuilder<EmployeeBankInformation> builder)
{
builder.ToTable("EmployeeBankInformationSet");
builder.Property(x => x.BankAccountNumber).HasMaxLength(20);
builder.Property(x => x.CardNumber).HasMaxLength(16);
builder.Property(x => x.ShebaNumber).HasMaxLength(26);
builder.HasOne(x => x.Employee).WithMany(x => x.EmployeeBankInformationList)
.HasForeignKey(x => x.EmployeeId);
}
}
}