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 FMUserCCQueryGroupMap : TreeEntityBaseMap<T_FM_USER_C_C_QUERY_GROUP>
	{
		public override void Configure(EntityTypeBuilder<T_FM_USER_C_C_QUERY_GROUP> builder)
		{
			base.Configure(builder);
			builder.Property(t => t.TITLE).HasMaxLength(200);
			builder.Property(t => t.CODE).HasMaxLength(300);
			builder.HasOne(t => t.Nav_UserCCQuery).WithMany(t => t.Nav_Groups)
				.HasForeignKey(t => t.USER_C_C_QUERY_ID).OnDelete(DeleteBehavior.Restrict);

		} 
	}
}
