public Faculte CreerFaculte(string nom, Ecole ecole) { try { _bdd.Facultes.Add(new Faculte { Nom = nom, Ecole = ecole }); _bdd.SaveChanges(); //var lecole = ObtenirEcole(ecole.Id); //lecole?.Facultes.Add(_bdd.Facultes.ToList().Last()); // _bdd.SaveChanges(); return(_bdd.Facultes.ToList().Last()); } catch (Exception e) { Console.WriteLine(e); return(null); } }
public List <Faculte> ObtenirListeFacultesDUnEcole(Ecole ecole) { return(ecole.Facultes.ToList()); }