Files
Backend-Api/CompanyManagment.EFCore/Mapping/RollCallServiceMapping.cs

39 lines
1.4 KiB
C#

using Company.Domain.RollCallServiceAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class RollCallServiceMapping : IEntityTypeConfiguration<RollCallService>
{
public void Configure(EntityTypeBuilder<RollCallService> 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);
}
}