19 lines
785 B
C#
19 lines
785 B
C#
using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace AccountMangement.Infrastructure.EFCore.Mappings
|
|
{
|
|
public class SubAccountPermissionSubtitle1Mapping : IEntityTypeConfiguration<SubAccountPermissionSubtitle1>
|
|
{
|
|
public void Configure(EntityTypeBuilder<SubAccountPermissionSubtitle1> builder)
|
|
{
|
|
builder.HasKey(x => x.id);
|
|
builder.ToTable("SubAccountPermissionSubtitle1");
|
|
builder.Property(x => x.Code).HasMaxLength(15).IsRequired();
|
|
builder.Property(x => x.Title).HasMaxLength(50).IsRequired();
|
|
builder.HasMany(x => x.Children).WithOne(x => x.Parent).HasForeignKey(x => x.ParentId);
|
|
}
|
|
}
|
|
}
|