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


namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
{
    public class ReadingPeriodSiteConfigration : IEntityTypeConfiguration<ReadingPeriodSite>
    {
       

        public void Configure(EntityTypeBuilder<ReadingPeriodSite> builder)
        {
         
            builder
            .HasOne(s => s.TrialSite)
            .WithMany(c => c.ReadingPeriodSites)
            .HasForeignKey(s => new { s.TrialId, s.SiteId })
            .HasPrincipalKey(c => new { c.TrialId, c.SiteId });
        }
    }
}
