예제 #1
0
        public ActionResult GroupFansByGender()
        {
            IQueryable <FanToGenderGroup> data = from fan in db.Fans
                                                 group fan by fan._gender into Gender
                                                 select new FanToGenderGroup()
            {
                gender    = Gender.Key,
                fansCount = Gender.Count()
            };

            return(View(data));
        }