ref: project structure
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user