Exemple #1
0
        /// <summary>
        /// Retourne l'élève correspondant à l'identifiant
        /// </summary>
        /// <param name="id">Identifiant de l'élève</param>
        /// <returns>Entité <see cref="Eleve"/></returns>
        public Eleve GetEleveById(int id)
        {
            EleveQuery query  = new EleveQuery(monContexte);
            Eleve      result = query.GetById(id);

            return(result);
        }
        public JsonResult Detail(int id)
        {
            Eleve eleve = eleveQuery.GetById(id).FirstOrDefault();

            eleve.Classe.Eleves = null;

            return(Json(JsonConvert.SerializeObject(eleve, Formatting.Indented, new JsonSerializerSettings {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            }), JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public Eleve GetEleveById(int idEleve)
        {
            EleveQuery eq = new EleveQuery(contexte);

            return(eq.GetById(idEleve));
        }