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

17 lines
580 B
C#

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