Files
Backend-Api/CompanyManagment.EFCore/Mapping/WorkingHoursTempMapping.cs
2024-07-05 21:36:15 +03:30

21 lines
718 B
C#

using Company.Domain.WorkingHoursTempAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class WorkingHoursTempMapping :IEntityTypeConfiguration<WorkingHoursTemp>
{
public void Configure(EntityTypeBuilder<WorkingHoursTemp> builder)
{
builder.ToTable("WorkingHoursTemp");
builder.HasKey(x => x.id);
builder.Property(x => x.ShiftWork).HasMaxLength(2);
builder.Property(x => x.WorkShopAddress2).HasMaxLength(500);
builder.HasMany(x => x.WorkingHoursTempItemList)
.WithOne(x => x.WorkingHoursTemp)
.HasForeignKey(x => x.WorkingHoursTempId);
}
}