BgEngine.Application.Services.StatsServices.RetrieveSidebarStats C# (CSharp) Method

RetrieveSidebarStats() public method

Get Stats for Sidebar Widget
public RetrieveSidebarStats ( bool ispremium ) : StatsDTO
ispremium bool
return BgEngine.Application.DTO.StatsDTO
        public StatsDTO RetrieveSidebarStats(bool ispremium)
        {
            StatsDTO model = new StatsDTO();
            if (ispremium)
            {
                model.TopRatedPosts = PostRepository.Get(p => p.Ratings.Any() && p.IsAboutMe == false, o => o.OrderByDescending(p => p.Ratings.Average(r => r.Value)), "Ratings").Take(10);
                model.MostVisitedPosts = PostRepository.Get(p => p.Visits > 0 && p.IsAboutMe == false, o => o.OrderByDescending(p => p.Visits)).Take(10);
                model.MostCommentedPosts = PostRepository.Get(p => p.Comments.Any() && p.IsAboutMe == false, o => o.OrderByDescending(c => c.Comments.Count()), "Comments").Take(10);
            }
            else
            {
                model.TopRatedPosts = PostRepository.Get(p => p.Ratings.Any() && p.IsPublic && p.IsAboutMe == false, o => o.OrderByDescending(p => p.Ratings.Average(r => r.Value)), "Ratings,Image").Take(10);
                model.MostVisitedPosts = PostRepository.Get(p => p.Visits > 0 && p.IsPublic && p.IsAboutMe == false, o => o.OrderByDescending(p => p.Visits), "Image").Take(10);
                model.MostCommentedPosts = PostRepository.Get(p => p.Comments.Any() && p.IsPublic && p.IsAboutMe == false, o => o.OrderByDescending(c => c.Comments.Count()), "Comments,Image").Take(10);
            }
            return model;
        }