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 FMClassMap : APTEntityBaseMap<T_FM_CLASS>
    {
		public override void Configure(EntityTypeBuilder<T_FM_CLASS> builder)
		{
			base.Configure(builder);
			builder.Property(t => t.CODE).HasMaxLength(100);
			builder.Property(t => t.NAME).HasMaxLength(100);
            builder.Property(t => t.NAME_ACRONYM).HasMaxLength(200);
            builder.Property(t => t.REMARK).HasMaxLength(500);

			//relation
			builder.HasMany(t => t.Nav_ClassDetail).WithOne().HasForeignKey(t => t.CLASS_ID).OnDelete(DeleteBehavior.Restrict);
		} 
      
    }
}
