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