using IRaCIS.Core.Domain.Models;
//using IRaCIS.Core.Infra.EFCore.ValueGenerator;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;


namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
{
    public class StudyMonitorConfigration : IEntityTypeConfiguration<StudyMonitor>
    {
       

        public void Configure(EntityTypeBuilder<StudyMonitor> builder)
        {
            //   builder
            // .HasMany(s => s.TrialSiteUserList)
            //.WithOne(c => c.DicomStudy)
            //.HasForeignKey(s => new { s.TrialId, s.SiteId })
            //.HasPrincipalKey(c => new { c.TrialId, c.SiteId });

            //builder.Property(e => e.TotalMillisecondsInterval).HasValueGenerator<UploadTotalMillisecondsInterval>().ValueGeneratedOnAdd();


            builder
        .HasOne(s => s.TrialSite)
        .WithMany(c => c.StudyMonitorList)
        .HasForeignKey(s => new { s.TrialId, s.SiteId })
        .HasPrincipalKey(c => new { c.TrialId, c.SiteId });

        }
    }
}
