using Company.Domain.RollCallEmployeeStatusAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace CompanyManagment.EFCore.Mapping { public class RollCallEmployeeStatusMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(x => x.id); builder.Property(x => x.EndDate).IsRequired(); builder.Property(x => x.StartDate).IsRequired(); builder.Property(x => x.RollCallEmployeeId).IsRequired(); builder.HasOne(x => x.RollCallEmployee) .WithMany(x => x.EmployeesStatus).HasForeignKey(x => x.RollCallEmployeeId); } } }