IQueryable<Content>.Count(): unexpected result
Hi,
I'm not sure whether this is a bug or not. Can anyone help?
var news = App.WorkWith().NewsItems().Publihed()
.OrderByDescending(t => t.PublicationDate)
.Get();
int
count = news.Count();
// count = 1068
news = news.Take(5);
int
count2 = news.Count();
// count2 = 1068 (expected = 5 or below)
Hi Thomas,
Thank you for using our services. Although I did not find any bug logged about this issue, I have tried it on our latest officially supported version - Sitefinity 5.0, and the correct count is returned. For your convenience I'm attaching a sample video demonstrating the default behavior I'm observing.
Regards,
Boyan Barnev
the Telerik team
Hi Boyan,
Thanks for your answer. I'll try again when we update to Sitefinity 5.0 and report back (if I don't forget...). Meanwhile, as a workaround, I used ToArray().Length.
Confirmed as fixed in Sitefinity 5.0.