Files

19 lines
695 B
C#
Raw Permalink Normal View History

2026-08-19 23:25:08 +07:00
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using mws.backend.dotnet.domain.MasterData;
namespace mws.backend.dotnet.infrastructure.Persistence.Configuration;
public class MasterDataEntryConfiguration : IEntityTypeConfiguration<MasterDataEntry>
{
public void Configure(EntityTypeBuilder<MasterDataEntry> e)
{
e.ToTable("master_data");
e.HasKey(m => m.Id);
e.Property(m => m.Group).HasMaxLength(100).IsRequired();
e.Property(m => m.Label).HasMaxLength(200).IsRequired();
e.Property(m => m.Value).HasMaxLength(100).IsRequired();
e.HasIndex(m => new { m.Group, m.Value }).IsUnique();
}
}