Skip to main content

Listing the child groups for a group can be achived by using one of the Children method overloads.

List with page options

Lists child groups, specifying page options.

Syntax

C#
public PagedList<Group> Children(SecurityListOptions listOptions = null)
{    
}

Parameters

listOptions

Type: SecurityListOptions
The list options, page size, page index, etc.

Examples

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

Group systemAdministrators = client.Security.Groups.Get("System Administrators");

// Setup the list options, setting a page size of 10 and ordering by group name
SecurityListOptions listOptions = new SecurityListOptions
{
    PageOptions = new PageOptions(0, 10),
    Order = "name"
};

// List the child groups
PagedList<Group> groups = systemAdministrators.Children(listOptions);

List with page options async

Lists child groups, specifying page options asynchronously.

Syntax

C#
public Task<PagedList<Group>> ChildrenAsync(SecurityListOptions listOptions = null)
{    
}

Parameters

listOptions

Type: SecurityListOptions
The list options, page size, page index, etc.

Examples

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

Group systemAdministrators = await client.Security.Groups.GetAsync("System Administrators");

// Setup the list options, setting a page size of 10 and ordering by group name
SecurityListOptions listOptions = new SecurityListOptions
{
    PageOptions = new PageOptions(0, 10),
    Order = "name"
};

// List the child groups
PagedList<Group> groups = await systemAdministrators.ChildrenAsync(listOptions);

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request