mh_sms/APT.BaseData.Data/Mapping/FM/FMRoleMenuPermBtnMap.cs
2024-04-12 16:50:28 +08:00

20 lines
706 B
C#

using APT.Infrastructure.EF.Map;
using APT.BaseData.Domain.Entities.FM;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
namespace APT.BaseData.Data.Mapping.FM.System
{
public class FMRoleMenuPermBtnMap : APTEntityBaseMap<T_FM_ROLE_MENU_PERM_BTN>
{
public override void Configure(EntityTypeBuilder<T_FM_ROLE_MENU_PERM_BTN> builder)
{
base.Configure(builder);
builder.HasOne(t => t.Nav_RoleMenuPermission).WithMany(t => t.Nav_PermissionBtns)
.HasForeignKey(t => t.ROLE_MENU_PERMISSION_ID).OnDelete(DeleteBehavior.Restrict);
builder.HasOne(t => t.Nav_Btn).WithMany().HasForeignKey(t => t.BTN_ID).OnDelete(DeleteBehavior.Restrict);
}
}
}