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 FMUserCCTableMap : APTEntityBaseMap<T_FM_USER_C_C_TABLE>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_C_C_TABLE> builder)
		{
			base.Configure(builder);
			builder.HasOne(t => t.Nav_PageTable).WithMany().HasForeignKey(t => t.PAGE_TABLE_ID).OnDelete(DeleteBehavior.Restrict);
			builder.HasOne(t => t.Nav_UserCustomConfig).WithMany(t => t.Nav_Tabls).HasForeignKey(t => t.USER_CUSTOM_CONFIG_ID).OnDelete(DeleteBehavior.Restrict);
		} 
	}
}
