コード例 #1
0
        public ActionResult Index()
        {
            ViewBag.Title = "Home Page";
            HomepageData model = new HomepageData();

            foreach (var ws in websiteRepository.GetWebsites())
            {
                model.Stats.Add(new WebsiteStats()
                {
                    ActivityCount = visitRepository.GetActivityCount(ws.ID),
                    Site          = ws,
                    VisitCount    = visitRepository.GetVisitCount(ws.ID)
                });
            }
            model.WebsiteCount  = websiteRepository.GetWebsites().Count();
            model.WebpageCount  = webpageRepository.GetWebpageCount();
            model.VisitCount    = visitRepository.GetVisitCount();
            model.ActivityCount = visitRepository.GetActivityCount();
            return(View(model));
        }