using Company.Domain.RollCallServiceAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace CompanyManagment.EFCore.Mapping; public class RollCallServiceMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("RollCallServices"); builder.HasKey(x => x.id); builder.Property(x => x.ServiceType).HasMaxLength(20); builder.Property(x => x.StartService); builder.Property(x => x.EndService); builder.Property(x => x.AccountId); builder.Property(x => x.WorkshopId); builder.Property(x => x.IsActiveString).HasMaxLength(5); builder.Property(x => x.MaxPersonValid); builder.Property(x => x.Amount); builder.Property(x => x.CreationDate); builder.Property(x => x.Duration).HasMaxLength(2); #region CustomizeChekoutService builder.Property(x => x.CustomizeCheckoutServiceStart).IsRequired(false); builder.Property(x => x.CustomizeCheckoutServiceEnd).IsRequired(false); builder.Property(x => x.HasCustomizeCheckoutService).HasMaxLength(5); builder.Property(x => x.CustomizeCheckoutAmount); #endregion builder.HasOne(x => x.Workshop) .WithMany(x => x.RollCallServicesList) .HasForeignKey(x => x.WorkshopId); } }