AI OnAI Off
Try child.ContentLink
You can also use GetDescendants (not cached). Depends what you are trying to do...
Thanks Aniket. I'm not seeing a ContentLink property via Intellisense or the documentation. Errors that I'm seeing when attempting that are in the comments below.
foreach (ContentData child in contentDataList)
{
var x = child.ContentLink; // Cannot assign method group to an implicitly-typed variable.
List<ContentData> children = contentLoader.GetChildren<ContentData>(child.ContentLink); // Cannot convert from 'method group' to 'ContentReference'
}
Where is the GetDescendants method for that? I don't see that either. Do I need to cast that ContentData child object first?
What I'd like to do is get the descendants of that ContentData child object. Thanks.
So I'm trying to build a recursive tree of ContentData objects starting from the ContentReference.RootPage. I'm working in EPiServer 8. It looks like the IContentLoader method GetChildren would do the trick, but it's only allowing me to send a ContentReference to the GetChildren argument.
If I knew how to convert a ContentData object to a ContentReference object, I could probably make this work. But I don't know if that's possible. Here is my latest attempt.
How can I get the children of a ContentData object? Thank you.