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

19 lines
700 B
C#
Raw Permalink Normal View History

2024-04-12 16:50:28 +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 FMRoleGroupBelongRoleMap : APTEntityBaseMap<T_FM_ROLE_GROUP_BELONG_ROLE>
{
public override void Configure(EntityTypeBuilder<T_FM_ROLE_GROUP_BELONG_ROLE> builder)
{
base.Configure(builder);
builder.HasOne(t => t.Nav_RoleGroup).WithMany(t => t.Nav_BelongRoles).HasForeignKey(t => t.ROLE_GROUP_ID).OnDelete(DeleteBehavior.Restrict);
builder.HasOne(t => t.Nav_BelongRole).WithMany().HasForeignKey(t => t.BELONG_ROLE_ID).OnDelete(DeleteBehavior.Restrict);
}
}
}