Files
Backend-Api/CompanyManagment.EFCore/Mapping/ClassificationEmployeeMapping.cs
2025-09-18 05:16:00 +03:30

22 lines
756 B
C#

using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationEmployeeMapping : IEntityTypeConfiguration<ClassificationEmployee>
{
public void Configure(EntityTypeBuilder<ClassificationEmployee> builder)
{
builder.ToTable("ClassificationEmployee");
builder.HasKey(x => x.id);
builder.Property(x => x.StartGroupDate).IsRequired(false);
builder.Property(x => x.EndGroupDate).IsRequired(false);
builder.HasOne(x => x.ClassificationGroup)
.WithMany(x => x.ClassificationEmployees)
.HasForeignKey(x => x.ClassificationGroupId);
}
}