Files
Backend-Api/CompanyManagment.EFCore/Mapping/ContractingPartyTempMapping.cs
2025-03-16 18:45:50 +03:30

32 lines
1.4 KiB
C#

using System;
using _0_Framework.Application;
using Company.Domain.TemporaryClientRegistrationAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ContractingPartyTempMapping : IEntityTypeConfiguration<ContractingPartyTemp>
{
public void Configure(EntityTypeBuilder<ContractingPartyTemp> builder)
{
builder.ToTable("ContractingPartyTemp");
builder.HasKey(x => x.id);
builder.Property(x => x.FName).HasMaxLength(25).IsRequired();
builder.Property(x => x.LName).HasMaxLength(25).IsRequired();
builder.Property(x => x.NationalCode).HasMaxLength(10).IsRequired();
builder.Property(x => x.IdNumber).HasMaxLength(10).IsRequired(false);
builder.Property(x => x.Phone).HasMaxLength(12);
builder.Property(x => x.FatherName).HasMaxLength(25);
builder.Property(x => x.State).HasMaxLength(35);
builder.Property(x => x.City).HasMaxLength(35);
builder.Property(x => x.Address).HasMaxLength(500);
builder.Property(x => x.IdNumberSeri).HasMaxLength(5);
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
builder.Property(x => x.Gender).HasConversion(
v => v.ToString(),
v => (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
builder.Property(x => x.DateOfBirth);
}
}