Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
When i get the Content from Umbraco Apis, i use this method
var Nodes= umbracoHelper.TypedContentAtRoot().DescendantsOrSelf("docTypeAlias");
is there a cleaner way?or more optimized way? since it queries the complete Umbraco tree
Hi
you are right there is some info about avoiding DescendantsOrSelf in the Common Pitfalls section of the documention.
On of the quickest* alternatives is to use the XPath functions to query the Cache and get the documents that way
var nodes = umbracoHelper.TypedXpath("//docTypeAlias") ;
This will query the Umbraco cache and return all the doctypes way faster (as it doesn't load the published content items to do the query)
*Examine is also a quick way, but i think people doing performance tests have found the xpath as quick if not quicker in some situations.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get Content From Umbraco Api (UmbracoHelper)
When i get the Content from Umbraco Apis, i use this method
is there a cleaner way?or more optimized way? since it queries the complete Umbraco tree
Hi
you are right there is some info about avoiding DescendantsOrSelf in the Common Pitfalls section of the documention.
On of the quickest* alternatives is to use the XPath functions to query the Cache and get the documents that way
This will query the Umbraco cache and return all the doctypes way faster (as it doesn't load the published content items to do the query)
*Examine is also a quick way, but i think people doing performance tests have found the xpath as quick if not quicker in some situations.
is working on a reply...