S
shapper
Hello,
I create the following Linq query to select all the tags associated to
Posts:
viewData.TagsPapers = (from t in database.Tags
select new TagPaper {
Tag = t,
Count = t.PostsTags.Count
} into tp
where tp.Count != 0
orderby tp.Count descending
select tp).Take(20).OrderBy(tp =>
tp.Tag.Name).ToList();
I would like to select and count the tags but only the ones that are
related to Posts that are published.
Post object in Posts table has a property named IsPublished which is
true when it is published.
Any idea of how to transform my query to also accomplish this.
Thanks,
Miguel
I create the following Linq query to select all the tags associated to
Posts:
viewData.TagsPapers = (from t in database.Tags
select new TagPaper {
Tag = t,
Count = t.PostsTags.Count
} into tp
where tp.Count != 0
orderby tp.Count descending
select tp).Take(20).OrderBy(tp =>
tp.Tag.Name).ToList();
I would like to select and count the tags but only the ones that are
related to Posts that are published.
Post object in Posts table has a property named IsPublished which is
true when it is published.
Any idea of how to transform my query to also accomplish this.
Thanks,
Miguel