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

19 lines
610 B
C#

using Company.Domain.MasterPenaltyTitle;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class MasterPenaltyTitleMapping : IEntityTypeConfiguration<MasterPenaltyTitle>
{
public void Configure(EntityTypeBuilder<MasterPenaltyTitle> builder)
{
builder.ToTable("Master_PenaltyTitles");
builder.HasKey(x => x.id);
//TODO
//add validations
builder.HasOne(x => x.MasterPetition).WithMany(x => x.MasterPenaltyTitlesList).HasForeignKey(x => x.MasterPetition_Id);
}
}