using System; using _0_Framework.Application.Enums; using Company.Domain.SmsResultAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace CompanyManagment.EFCore.Mapping; public class SmsSettingMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("SmsSettings"); builder.HasKey(x => x.id); builder.Property(x => x.DayOfMonth) .IsRequired(); builder.Property(x => x.TimeOfDay) .HasColumnType("time(0)") .IsRequired(); builder.Property(x => x.TypeOfSmsSetting).HasConversion( v => v.ToString(), v => (TypeOfSmsSetting)Enum.Parse(typeof(TypeOfSmsSetting), v)).HasMaxLength(70); } }