// GET: AprendizajeEnSaber public ActionResult Index() { List <Aprendizaje> aprendizajes = Aprendizajes.LeerHabilitados(); if (aprendizajes == null) { aprendizajes = new List <Aprendizaje>(); } foreach (Aprendizaje apr in aprendizajes) { apr.Saberes = Aprendizajes.LeerSubSaberes(apr.Codigo); //Ordenar las SubSaberes según el codigo para evitar que se vean desordenadas :) //apr.Saberes.Sort((x, y) => x.Codigo.CompareTo(y.Codigo)); if (apr.Saberes == null) { apr.Saberes = new List <Saber>(); } } return(View(aprendizajes)); }