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