Ejemplo n.º 1
0
 public PartialViewResult GetMainStats()
 {
     var viewModel = new MainStatsViewModel
                         {
                             LatestMembers = MembershipService.GetLatestUsers(10),
                             MemberCount = MembershipService.MemberCount(),
                             TopicCount = _topicService.TopicCount(),
                             PostCount = _postService.PostCount()
                         };
     return PartialView(viewModel);
 }
Ejemplo n.º 2
0
        public PartialViewResult GetMainStats()
        {
            var viewModel = new MainStatsViewModel
                                {
                                    MemberCount = MembershipService.MemberCount(),
                                    TopicCount = _topicService.TopicCount(),
                                    PostCount = _postService.PostCount()
                                };

            viewModel.LatestMembers = new System.Collections.Generic.List<System.Tuple<string, string>>();
            foreach (var user in MembershipService.GetLatestUsers(10))
            {
                if (viewModel.LatestMembers.All(u => u.Item1 != user.UserName))
                {
                    viewModel.LatestMembers.Add(new Tuple<string, string>(user.UserName,user.NiceUrl));
                }
            }

            return PartialView(viewModel);
        }