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

22 lines
748 B
C#

using Company.Domain.InsurancJobAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class InsuranceJobMapping : IEntityTypeConfiguration<InsuranceJob>
{
public void Configure(EntityTypeBuilder<InsuranceJob> builder)
{
builder.ToTable("InsuranceJobs");
builder.HasKey(x => x.id);
builder.Property(x => x.InsuranceJobTitle).HasMaxLength(100);
builder.Property(x => x.Year).HasMaxLength(4);
builder.Property(x => x.EconomicCode).HasMaxLength(255);
builder.HasMany(x => x.InsuranceJobItemList)
.WithOne(x => x.InsuranceJob)
.HasForeignKey(x => x.InsuranceJobId);
}
}