using AccountManagement.Domain.TaskScheduleAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace AccountMangement.Infrastructure.EFCore.Mappings; public class TaskScheduleMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("TaskSchedules"); builder.HasKey(x => x.id); builder.Property(x => x.Count).HasMaxLength(10); builder.Property(x => x.Type).HasConversion().HasMaxLength(12); builder.Property(x => x.UnitNumber).HasMaxLength(10); builder.Property(x => x.UnitType).HasConversion().HasMaxLength(10); builder.Property(x => x.IsActive).HasConversion().HasMaxLength(5); builder.HasMany(x => x.TasksList).WithOne(x => x.TaskSchedule) .HasForeignKey(x => x.TaskScheduleId); } }