Files
Backend-Api/CompanyManagment.EFCore/Mapping/WorkshopPlanEmployeeMapping.cs
2024-07-09 19:31:25 +03:30

24 lines
855 B
C#

using Company.Domain.WorkshopPlanEmployeeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class WorkshopPlanEmployeeMapping : IEntityTypeConfiguration<WorkshopPlanEmployee>
{
public void Configure(EntityTypeBuilder<WorkshopPlanEmployee> builder)
{
builder.ToTable("WorkshopPlanEmployees");
builder.HasKey(x => x.id);
builder.Property(x => x.EmployeeFullName).HasMaxLength(100);
builder.Property(x => x.EmployeeId);
builder.Property(x => x.WorkshopPlanId);
builder.Property(x => x.WorkshopId);
builder.Property(x => x.CreationDate);
builder.HasOne(x => x.WorkshopPlan)
.WithMany(x => x.WorkshopPlanEmployees)
.HasForeignKey(x => x.WorkshopPlanId);
}
}