Files
Backend-Api/AccountMangement.Infrastructure.EFCore/Mappings/SubAccountPermissionSubtitle1Mapping.cs
2025-01-04 18:00:04 +03:30

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);
}
}
}