using IRaCIS.Core.Domain.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;


namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
{
    public class TrialSiteConfigration : IEntityTypeConfiguration<TrialSite>
    {


        public void Configure(EntityTypeBuilder<TrialSite> builder)
        {


        }
    }

    public class SubjectCriteriaEvaluationConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluation>
    {


        public void Configure(EntityTypeBuilder<SubjectCriteriaEvaluation> builder)
        {
            builder
           .HasMany(s => s.SubjectCriteriaEvaluationVisitFilterList)
            .WithOne(c => c.SubjectCriteriaEvaluation)
            .HasForeignKey(s => new { s.SubjectId, s.TrialReadingCriterionId })
            .HasPrincipalKey(c => new { c.SubjectId, c.TrialReadingCriterionId });

        }
    }


}
