Files
Backend-Api/CompanyManagment.EFCore/Mapping/RollCallEmployeeStatusMapping.cs
2024-08-29 15:00:22 +03:30

22 lines
692 B
C#

using Company.Domain.RollCallEmployeeStatusAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping
{
public class RollCallEmployeeStatusMapping : IEntityTypeConfiguration<RollCallEmployeeStatus>
{
public void Configure(EntityTypeBuilder<RollCallEmployeeStatus> 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);
}
}
}