d_sms_service/APT.BaseData.Data/Mapping/FM/FMRoleMenuPermBtnMap.cs

20 lines
706 B
C#
Raw Normal View History

2024-10-28 13:45:58 +08:00
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);
}
}
}