public ITreeNode GetDocument(int NodeID, string PageType = null, string[] Columns = null) { DocumentQuery Query = (!string.IsNullOrWhiteSpace(PageType) ? new DocumentQuery(PageType) : new DocumentQuery()); Query.Culture(cultureName) .CombineWithDefaultCulture() .CombineWithAnyCulture() .Published(!latestVersionEnabled) .LatestVersion(latestVersionEnabled) .OnSite(_SiteRepo.CurrentSiteName()); if (Columns != null && Columns.Length > 0) { Query.Columns(Columns); } Query.WhereEquals("NodeID", NodeID); return(Query.FirstOrDefault()); }
private ITreeNode GetDocumentByNodeGuidInternal(Guid NodeGuid, string SiteName, string Culture, string[] Columns = null, string PageType = null) { DocumentQuery Query = (!string.IsNullOrWhiteSpace(PageType) ? new DocumentQuery(PageType) : new DocumentQuery()); Query.Culture(Culture) .CombineWithDefaultCulture() .CombineWithAnyCulture() .Published(!_repoContext.PreviewEnabled()) .LatestVersion(_repoContext.PreviewEnabled()) .OnSite(SiteName); if (Columns != null && Columns.Length > 0) { Query.Columns(Columns); } Query.WhereEquals("NodeGuid", NodeGuid); return(Query.FirstOrDefault()); }
public ITreeNode GetDocumentByNodeID(int NodeID, string Culture, string[] Columns = null, string PageType = null) { DocumentQuery Query = (!string.IsNullOrWhiteSpace(PageType) ? new DocumentQuery(PageType) : new DocumentQuery()); string CultureToUse = (!string.IsNullOrWhiteSpace(Culture) ? Culture : _repoContext.CurrentCulture()); Query.Culture(CultureToUse) .CombineWithDefaultCulture() .CombineWithAnyCulture() .Published(!_repoContext.PreviewEnabled()) .LatestVersion(_repoContext.PreviewEnabled()); if (Columns != null && Columns.Length > 0) { Query.Columns(Columns); } Query.WhereEquals("NodeID", NodeID); return(Query.FirstOrDefault()); }