30 lines
828 B
C#
30 lines
828 B
C#
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<SmsSetting>
|
|
{
|
|
public void Configure(EntityTypeBuilder<SmsSetting> 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(30);
|
|
|
|
|
|
}
|
|
} |