コード例 #1
0
        // GET: AprendizajeEnSaber
        public ActionResult Index()
        {
            List <Unidad> unidades = Unidades.LeerTodo();

            if (unidades == null)
            {
                unidades = new List <Unidad>();
            }
            foreach (Unidad uni in unidades)
            {
                uni.Saberes = Unidades.LeerSubSaberes(uni.Id);

                //Ordenar las SubSaberes según el codigo para evitar que se vean desordenadas :)
                //apr.Saberes.Sort((x, y) => x.Codigo.CompareTo(y.Codigo));

                if (uni.Saberes == null)
                {
                    uni.Saberes = new List <Saber>();
                }
            }

            return(View(unidades));
        }