mh_sms/APT.BaseData.Data/Mapping/FM/FMRoleMenuPermMap.cs

19 lines
681 B
C#
Raw Permalink Normal View History

2024-01-22 09:17:01 +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
{
public class FMRoleMenuPermMap : APTEntityBaseMap<T_FM_ROLE_MENU_PERM>
{
public override void Configure(EntityTypeBuilder<T_FM_ROLE_MENU_PERM> builder)
{
base.Configure(builder);
builder.HasOne(t => t.Nav_PermissionForm).WithMany().HasForeignKey(t => t.PERMISSION_FORM_ID).OnDelete(DeleteBehavior.Restrict);
builder.HasOne(t => t.Nav_Role).WithMany(t => t.Nav_MenuPermissions).
HasForeignKey(t => t.ROLE_ID).OnDelete(DeleteBehavior.Restrict);
}
}
}