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 FMUserCCTableColMap : APTEntityBaseMap<T_FM_USER_C_C_TABLE_COL>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_C_C_TABLE_COL> builder)
		{
			base.Configure(builder);
			builder.HasOne(t => t.Nav_Column).WithMany().HasForeignKey(t => t.COLUMN_ID).OnDelete(DeleteBehavior.Restrict);
			builder.HasOne(t => t.Nav_UserCCTable).WithMany(t => t.Nav_Columns).HasForeignKey(t => t.USER_C_C_TABLE_ID).OnDelete(DeleteBehavior.Restrict);
			builder.Property(t => t.LABEL).HasMaxLength(200);
		} 
	}
}
