ContentService.GetAncestors Method

Namespace:
Weavy.Core.Services
Assembly:
Weavy.Core.dll

Overloads

GetAncestors(int, bool, bool) Get ancestors of the specified content item, starting with the closest parent and ending with the root.
GetAncestors(int, bool, bool) Get ancestors of the specified content item, starting with the closest parent and ending with the root.

GetAncestors(int, bool, bool)

Get ancestors of the specified content item, starting with the closest parent and ending with the root.

public static IEnumerable<Content> GetAncestors(int id, bool sudo = false, bool trashed = false)

Parameters

id
int

Id of the content item.

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 list of objects implementing the Content interface.

GetAncestors(int, bool, bool)

Get ancestors of the specified content item, starting with the closest parent and ending with the root.

public static IEnumerable<T> GetAncestors<T>(int id, bool sudo = false, bool trashed = false)
    where T : Content

Parameters

id
int

Id of the content item.

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 list of content items of type T.