On Sep 3, 10:15*pm, Marc Gravell <marc.grav...@gmail.comwrote:
either: where t.FilesTags.Count != 0
or:
select new TagPaper {
* Tag = t,
* FileCount = t.FilesTags.Count,
* PostCount = t.PostsTags.Count} into tmp
where tmp.FileCount != 0
select tmp).ToList();
I have the following:
viewData.TagsPapers = (from t in database.Tags
orderby t.Name
select new TagPaper {
Tag = t,
PostCount = t.PostsTags.Count
} into tp
where tp.PostCount != 0
orderby tp.PostCount
select tp).Take(50).ToList();
I need the items to be ordered by name but before that I want to get
the 50 items with the highest PostCount.
So I ordered it by PostCount and used Take(50).
However, I think Take is getting the first 50 items of the final list
and not from the tp which is ordered by PostCount.
Does this makes any sense? How can I fix this?
Note: I am using take because I think there is no TOP in Linq.
Thanks,
Miguel