19 lines
695 B
C#
19 lines
695 B
C#
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();
|
||
|
|
}
|
||
|
|
}
|