using Company.Domain.EmployeeInsuranceRecordAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace CompanyManagment.EFCore.Mapping; class EmployeeInsuranceRecordMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("EmployeeInsuranceRecord"); builder.HasKey(x => x.id); builder.Property(x => x.DateOfStart).IsRequired(); builder.Property(x => x.DateOfEnd).IsRequired(false); } }