Files
Backend-Api/CompanyManagment.EFCore/Mapping/InstitutionContractAmendmentMapping.cs

22 lines
831 B
C#

using Company.Domain.InstitutionContractAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class InstitutionContractAmendmentMapping:IEntityTypeConfiguration<InstitutionContractAmendment>
{
public void Configure(EntityTypeBuilder<InstitutionContractAmendment> builder)
{
builder.ToTable("InstitutionContractAmendments");
builder.HasKey(x => x.id);
builder.Property(x => x.VerifyCode).HasMaxLength(10);
builder.Property(x => x.VerifierFullName).HasMaxLength(100);
builder.Property(x => x.VerifierPhoneNumber).HasMaxLength(20);
builder.HasOne(x => x.InstitutionContract)
.WithMany(x => x.Amendments)
.HasForeignKey(x => x.InstitutionContractId);
}
}