mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Optimized Blog Post counting
--HG-- branch : dev
This commit is contained in:
parent
cae7f5852e
commit
873ab417d7
@ -35,8 +35,8 @@ namespace Orchard.Blogs.Handlers {
|
||||
// Ensure we get the "right" set of published posts for the blog
|
||||
blog.ContentItem.ContentManager.Flush();
|
||||
|
||||
var posts = _blogPostService.Get(blog, VersionOptions.Published).ToList();
|
||||
blog.PostCount = posts.Count;
|
||||
var postsCount = _blogPostService.Get(blog, VersionOptions.Published).Count();
|
||||
blog.PostCount = postsCount;
|
||||
});
|
||||
|
||||
OnInitializing<BlogPost>((context, bp) => {
|
||||
|
Loading…
Reference in New Issue
Block a user