22 lines
756 B
C#
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);
|
|
}
|
|
} |