Files
Backend-Api/AccountMangement.Infrastructure.EFCore/Mappings/SubAccountPermissionSubtitle4Mapping.cs

22 lines
806 B
C#

using AccountManagement.Domain.SubAccountPermissionSubtitle4Agg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings
{
public class SubAccountPermissionSubtitle4Mapping : IEntityTypeConfiguration<SubAccountPermissionSubtitle4>
{
public void Configure(EntityTypeBuilder<SubAccountPermissionSubtitle4> builder)
{
builder.HasKey(x => x.id);
builder.ToTable("SubAccountPermissionSubtitle4");
builder.Property(x => x.Code).HasMaxLength(15).IsRequired();
builder.Property(x => x.Title).HasMaxLength(50).IsRequired();
builder.HasOne(x => x.Parent).WithMany(x => x.Children).HasForeignKey(x => x.ParentId);
}
}
}