Person |
Determines if a person is a child of another person.
Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public bool IsChildOf( Guid personId, Guid parentId, bool includeArchived )
Parameters
- personId Guid
- The unique identifier of the child person.
- parentId Guid
- The unique identifier of the parent person.
- includeArchived Boolean
- Whether to include archived persons in the check.
Return Value
BooleanTrue if the person is a child of the specified parent; otherwise, false.
Implements
ISimpleClientPersonRepositoryV4.IsChildOf(Guid, Guid, Boolean)Example
This example demonstrates how to check if a person is a child of a given parent entity, with option to include archived persons.
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(); var examplePerson = new SimplePersonV1( Guid.NewGuid(), EntityRoot.Person, PersonCategory.Person); examplePerson.Data["Surname"] = "examplePerson"; client.Persons.Create(examplePerson); client.Persons.Archive(examplePerson); var result = client.Persons.IsChildOf(examplePerson.Id, EntityRoot.Person, false); var result2 = client.Persons.IsChildOf(examplePerson.Id, EntityRoot.Person, true); // Includes archived persons // Disconnect from server client.Disconnect(); } }
See Also