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 FMUserBelongUserGroupMap : APTEntityBaseMap<T_FM_USER_BELONG_USER_GROUP>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_BELONG_USER_GROUP> builder)
		{
			base.Configure(builder);
			builder.HasOne(t => t.Nav_BelongUserGroup).WithMany().HasForeignKey(t => t.BELONG_USER_GROUP_ID).OnDelete(DeleteBehavior.Restrict);
			builder.HasOne(t => t.Nav_User).WithMany(t => t.Nav_BelongUserGroups).HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);

		} 
	}
}
