JustBlog.Core.BlogRepository.TotalPosts C# (CSharp) Méthode

TotalPosts() public méthode

Return total no. of all or published posts.
public TotalPosts ( bool checkIsPublished = true ) : int
checkIsPublished bool True to count only published posts
Résultat int
        public int TotalPosts(bool checkIsPublished = true)
        {
            return _session.Query<Post>().Where(p => !checkIsPublished || p.Published == true).Count();
        }