RegionRepositoryV4.GetDirectChildren Method

Retrieves the direct children of a specific region.

Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public ISimpleCollection<SimpleRegionV1> GetDirectChildren(
	Guid regionId,
	Properties properties,
	bool includeNode
)

Parameters

regionId  Guid
The ID of the region.
properties  Properties
The properties to include in the result.
includeNode  Boolean
Whether to include the node itself in the result.

Return Value

ISimpleCollection<SimpleRegionV1>
A collection of direct child regions.

Implements

ISimpleClientRegionRepositoryV4.GetDirectChildren(Guid, Properties, Boolean)
Example
The following example illustrates how to get direct children of a region, with an options to retrieve Properties (None, Basic, All) and to include parent node
C#
using System;
using Gamanet.C4.SDK;
using Gamanet.C4.SimpleInterfaces;

public class Example
{
    static void Main()
    {
        // Create instance of simple client
        var client = new SimpleClient(ConnectorConfiguration.HttpClient);

        ConnectionInfoV1 token;
        // Connect to local server
        var connectionResult = client.Connect(new Uri("https://localhost/"), "Support", "support", out token);

        if (connectionResult != ConnectionResult.Successful)
        {
            Console.WriteLine("Connection unsuccessful, result: {0}", connectionResult);
            return;
        }

        Console.WriteLine("Connection result: {0}", connectionResult);
        Console.WriteLine();

        // Create the Example Region
        var exampleRegion = new SimpleRegionV1(
        Guid.NewGuid(),
        "ExampleRegion",
        EntityRoot.Region,
        RegionCategory.Region
        );

        // Create the Example Region
        var exampleRegion2 = new SimpleRegionV1(
        Guid.NewGuid(),
        "ExampleRegion2",
        EntityRoot.Region,
        RegionCategory.Region
        );
        // Create the Example Region
        var exampleRegion3 = new SimpleRegionV1(
        Guid.NewGuid(),
        "ChildOfRegion1",
        exampleRegion.Id,
        RegionCategory.Region
        );
        // Create region in db
        client.Regions.Create(exampleRegion);
        client.Regions.Create(exampleRegion2);
        client.Regions.Create(exampleRegion3);

        var resultWithoutNode = client.Regions.GetDirectChildren(EntityRoot.Region, Properties.None, false);
        var resultWithNode = client.Regions.GetDirectChildren(exampleRegion.Id, Properties.All, true);

        // Disconnect from server
        client.Disconnect();
    }
}
See Also

Reference

RegionRepositoryV4 Class
Gamanet.C4.SDK Namespace