using APT.BaseData.Domain.Entities;
using APT.Infrastructure.EF.Map;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace APT.BaseData.Data.Mapping
{
	public class PFParamSchemeDetailMap : APTEntityBaseMap<T_PF_PARAM_SCHEME_DETAIL>
	{
		public override void Configure(EntityTypeBuilder<T_PF_PARAM_SCHEME_DETAIL> builder)
		{
			base.Configure(builder);
			builder.HasOne(t => t.Nav_ParamScheme).
				WithMany(t => t.Nav_Details).HasForeignKey(t => t.PARAM_SCHEME_ID).OnDelete(DeleteBehavior.Restrict);
			builder.HasOne(t => t.Nav_ParamItem).
				WithMany().HasForeignKey(t => t.PARAM_ITEM_ID).OnDelete(DeleteBehavior.Restrict);

		}
		 
	}
}
