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 FMUserCustomConfigHTabMap : APTEntityBaseMap<T_FM_USER_CUSTOM_CONFIG_H_TAB>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_CUSTOM_CONFIG_H_TAB> 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_HiddenTables).HasForeignKey(t => t.USER_CUSTOM_CONFIG_ID).OnDelete(DeleteBehavior.Restrict);

		} 
	}
}
