21 lines
702 B
C#
21 lines
702 B
C#
using Company.Domain.InsuranceJobItemAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class InsuranceJobeItemMapping : IEntityTypeConfiguration<InsuranceJobItem>
|
|
{
|
|
public void Configure(EntityTypeBuilder<InsuranceJobItem> builder)
|
|
{
|
|
builder.ToTable("InsuranceJobItems");
|
|
builder.HasKey(x => x.id);
|
|
|
|
builder.Property(x => x.StartDate).IsRequired(false);
|
|
builder.Property(x => x.EndDate).IsRequired(false);
|
|
|
|
builder.HasOne(x => x.InsuranceJob)
|
|
.WithMany(x => x.InsuranceJobItemList)
|
|
.HasForeignKey(x => x.InsuranceJobId);
|
|
}
|
|
} |