Exemplo n.º 1
0
        public JsonResult getProjects()
        {
            List <Project> AllProjects;

            using (var ctx = new Context())
            {
                AllProjects = ctx.Projects.ToList();
            }
            int count = 0;

            foreach (Project element in AllProjects)
            {
                if (element.CurrentPeople == element.MaxPeople)
                {
                    AllProjects.RemoveAt(count);
                }
                count++;
            }

            return(Json(AllProjects, JsonRequestBehavior.AllowGet));
        }