/// <summary> /// Retourne toutes les classes /// </summary> /// <returns>Liste d'entités <see cref="Classe"/></returns> public List <Classe> GetAllClasses() { ClasseQuery query = new ClasseQuery(monContexte); List <Classe> result = query.GetAll(); return(result); }
public ActionResult Index() { var classes = classeQuery.GetAll().ToList().OrderByDescending(c => c.Eleves.Count); return(Json(JsonConvert.SerializeObject(classes, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }), JsonRequestBehavior.AllowGet)); }
public JsonResult GetClasses() { var classeList = classeQuery.GetAll().ToList(); return(Json(JsonConvert.SerializeObject(classeList, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }), JsonRequestBehavior.AllowGet)); }
public List <Classe> GetAllClasse() { ClasseQuery cq = new ClasseQuery(context); List <Classe> classes = new List <Classe>(); foreach (Classe c in cq.GetAll().ToList()) { c.Eleves = GetEleveByClasseId(c.Id); classes.Add(c); } return(classes); }
public void TestGetAllClasse() { //ARRANGE _context.Classes.Add(new Classe { Niveau = "CE2", NomEtablissement = "Ecole Primaires de ses morts" }); _context.Classes.Add(new Classe { Niveau = "CE1", NomEtablissement = "Ecole Primaires de ses morts" }); _context.Classes.Add(new Classe { Niveau = "CP", NomEtablissement = "Ecole Primaires de ses morts" }); _context.SaveChanges(); //ACT List <Classe> classes = query.GetAll().ToList(); //ASSERT Assert.IsTrue(classes.Count > 3); }
public List <Classe> GetClasses() { ClasseQuery query = new ClasseQuery(_contexte); return(query.GetAll()); }
/// <summary> /// Récupérer une liste de classe en base /// </summary> /// <returns>Liste de Classe</returns> public List <Classe> GetAllClasse() { ClasseQuery cq = new ClasseQuery(contexte); return(cq.GetAll().ToList()); }