public ActionResult Stats()
        {
            IQueryable <EnrollmentDateGroup> data = from student in db.Students
                                                    group student by student.EnrollmentDate into DateGroup
                                                    select new EnrollmentDateGroup()
            {
                EnrollmentDate = DateGroup.Key,
                StudentCount   = DateGroup.Count()
            };

            return(View(data.ToList()));
        }
Beispiel #2
0
        public ActionResult About()
        {
            var data = from student in db.Students
                       group student by student.Birth into DateGroup
                       select new BirthDateGroup()
            {
                Birth        = DateGroup.Key,
                StudentCount = DateGroup.Count()
            };

            return(View(data.ToList()));
        }