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

28 lines
1.1 KiB
C#

using Company.Domain.WorkingHoursTempItemAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class WorkingHoursTempItemMapping :IEntityTypeConfiguration<WorkingHoursTempItem>
{
public void Configure(EntityTypeBuilder<WorkingHoursTempItem> builder)
{
builder.ToTable("WorkingHoursTempItem");
builder.HasKey(x => x.id);
builder.Property(x => x.WeekNumber).HasMaxLength(10);
builder.Property(x => x.DayOfWork).HasMaxLength(1);
builder.Property(x => x.ComplexStart).HasMaxLength(5);
builder.Property(x => x.ComplexEnd).HasMaxLength(5);
builder.Property(x => x.RestTime).HasMaxLength(5);
builder.Property(x => x.Start1).HasMaxLength(5);
builder.Property(x => x.End1).HasMaxLength(5);
builder.Property(x => x.Start2).HasMaxLength(5);
builder.Property(x => x.End2).HasMaxLength(5);
builder.HasOne(x => x.WorkingHoursTemp)
.WithMany(x => x.WorkingHoursTempItemList)
.HasForeignKey(x => x.WorkingHoursTempId);
}
}