How do I use Take<> with GetDOcuments? Everytime I add in .Take(3) above .TypedResult it causes issues with my columns?
I am trying to only pull back 3 items for a repeater;
var caseStudies = DocumentHelper.GetDocuments("csm.casestudy") .Path("/work/%") .Culture(preferredCulture) .CombineWithDefaultCulture(CurrentSite.CombineWithDefaultCulture) .OnSite(CurrentSiteName) .Where(String.Format("(region like '%{0}%')", preferredRegion)) .Published() .OrderByDescending("Date") .TypedResult;
ShowcaseRepeater.DataSource = caseStudies;
Try to use TopN(3) with DocumentHelper
DocumentHelper.GetDocuments("csm.casestudy").TopN(3).Path ... or
DocumentHelper.GetDocuments("csm.casestudy").TopN(3).Path ...
caseStudies.Tables[0].AsEnumerable().Take(3)
Please, sign in to be able to submit a new answer.