From d7f93b4913b504c94af4649d874ace164d392f3c Mon Sep 17 00:00:00 2001 From: jboinembalome Date: Fri, 12 Mar 2021 09:25:32 +0100 Subject: [PATCH] =?UTF-8?q?EpContext:=20Ajout=20d'une=20propri=C3=A9t?= =?UTF-8?q?=C3=A9=20masqu=C3=A9=20IdDemandeFormation=20pour=20la=20cl?= =?UTF-8?q?=C3=A9=20=C3=A9trang=C3=A8re=20entre=20ParticipationFormation?= =?UTF-8?q?=20et=20DemandeFormation=20+=20Configuration=20de=20la=20relati?= =?UTF-8?q?on=20entre=20DemandeFormation=20et=20OrigineDemande?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EPAServeur/Context/EpContext.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); });