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 FMUserCCEditColMap : APTEntityBaseMap<T_FM_USER_C_C_EDIT_COL>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_C_C_EDIT_COL> builder)
		{
			base.Configure(builder);

			builder.Property(t => t.LABEL).HasMaxLength(300);
			builder.HasOne(t => t.Nav_EditColumn).WithMany().HasForeignKey(t => t.EDIT_COLUMN_ID).OnDelete(DeleteBehavior.Restrict);
			builder.HasOne(t => t.Nav_UserCCEdit).WithMany(t => t.Nav_EditColumns).HasForeignKey(t => t.USER_C_C_EDIT_ID).OnDelete(DeleteBehavior.Restrict);
		} 
	}
}
