using APT.Infrastructure.EF.Map;
using APT.BaseData.Domain.Entities.FM;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace APT.BaseData.Data.Mapping.FM
{
	public class FMUserBelongRoleGroupMap : APTEntityBaseMap<T_FM_USER_BELONG_ROLE_GROUP>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_BELONG_ROLE_GROUP> builder)
		{
			base.Configure(builder);
			builder.HasOne(t => t.Nav_BelongRoleGroup).WithMany().HasForeignKey(t => t.BELONG_ROLE_GROUP_ID).OnDelete(DeleteBehavior.Restrict);
			builder.HasOne(t => t.Nav_User).WithMany(t => t.Nav_BelongRoleGroups).HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
		} 
	}
}
