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

TotalPostsForTag() public méthode

Return total no. of posts belongs to a particular tag.
public TotalPostsForTag ( string tagSlug ) : int
tagSlug string Tag's url slug
Résultat int
        public int TotalPostsForTag(string tagSlug)
        {
            return _session.Query<Post>()
                     .Where(p => p.Published && p.Tags.Any(t => t.UrlSlug.Equals(tagSlug)))
                     .Count();
        }