diff --git a/EPAServeur/Context/EpContext.cs b/EPAServeur/Context/EpContext.cs index 104fdde..824872c 100644 --- a/EPAServeur/Context/EpContext.cs +++ b/EPAServeur/Context/EpContext.cs @@ -150,12 +150,14 @@ namespace EPAServeur.Context }); //Formation + + modelBuilder.Entity(entity => { entity.HasKey(e => e.IdDemandeFormation); entity.Property(e => e.IdDemandeFormation).ValueGeneratedOnAdd(); - entity.HasOne(e => e.ParticipationFormation).WithOne(e => e.DemandeFormation).HasForeignKey(d => d.IdParticipationFormation); - + entity.HasOne(e => e.ParticipationFormation).WithOne(e => e.DemandeFormation).HasForeignKey("IdDemandeFormation"); + entity.HasOne(o => o.OrigineDemande).WithMany().IsRequired(); }); modelBuilder.Entity(entity => @@ -190,6 +192,7 @@ namespace EPAServeur.Context { entity.HasKey(e => e.IdParticipationFormation); entity.Property(e => e.IdParticipationFormation).ValueGeneratedOnAdd(); + entity.Property("IdDemandeFormation"); entity.HasMany(e => e.Evaluation).WithOne(e => e.ParticipationFormation); });