ContentService.GetDescendants Method
- Namespace:
- Weavy.Core.Services
- Assembly:
- Weavy.Core.dll
GetDescendants(int, int?, bool, bool)
Returns (a flat list) of descendants for a content item. The items are sorted like a tree.
public static IEnumerable<Content> GetDescendants(int id, int? depth = default(int? ), bool sudo = false, bool trashed = false)
Parameters
- id
- int
Id of the content for which to get descendants.
- depth
- int?
The maximum depth of descendants to return, i.e. setting depth to 1 returns only the immediate children.
If depth is null
, all descendants are returned.
- sudo
- bool
true
to perform action as super user, otherwise false
.
- trashed
- bool
true
to return trashed items, otherwise false
.
Returns
System.Collections.Generic.IEnumerable
Returns a tree-sorted list of Content objects.