However, contentService only has a GetPagedChildren, it doesn't have the old GetChildren which V7 did.
All I want this for is to hold in an array or list so I can compare a value in each child with the value I get from the API to see if it exists.
Is there a better way to do this? I'm also aware that this is looking at the DB directly. I have a suspicion there's a way to look at the cache instead which would be quicker but can't find any info.
ContentService GetChildren
Umb 8.6.1
Upgrading the code from a V7 site to V8 I have a class called by an UmbracoApiController which needs to get a list of children of a particular node.
To get the ContentService I've had to use :-
which is not what the docs say here: https://our.umbraco.com/documentation/reference/management/services/contentservice/
However, contentService only has a GetPagedChildren, it doesn't have the old GetChildren which V7 did.
All I want this for is to hold in an array or list so I can compare a value in each child with the value I get from the API to see if it exists.
Is there a better way to do this? I'm also aware that this is looking at the DB directly. I have a suspicion there's a way to look at the cache instead which would be quicker but can't find any info.
Any comments or advice would be appreciated.
/ Craig
You can do it in this way
Thanks, that looks like it'll work.
It beats me why we don't have the simple cases of GetChildren() and GetDescendants(), but hey ho.
Cheers,
/ Craig
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.