PersonRepository.Get(Guid, String) Method

Get person by identifier with specified index properties.

Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public SimplePersonV1 Get(
	Guid personId,
	string prefix
)

Parameters

personId  Guid
The person identifier.
prefix  String
The prefix.

Return Value

SimplePersonV1
SimplePerson or null when does not exists

Implements

ISimpleClientPersonRepositoryV1.Get(Guid, String)
Example
The following example illustrates how SimpleClient provides person by Id with data prefix
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 new Example Person
        var examplePerson = new SimplePersonV1(
            Guid.NewGuid(),
            EntityRoot.Person,
            PersonCategory.Person);
        examplePerson.Data["Surname"] = "Example";

        var saltExample =
        "ra6lpDliQmUYJa99n3I8Zhas0iv0webozP8ib8PeqvNLDPbj5SRVIFQPyNrUQLjJSNTU+ZnWZGXff7ZkuwFvMaqJj8HFmZ5Ta" +
        "w3I4+WcEm2cl/UCZgOMtS2l7+uExcUSQqbnSgWA7yEcE806bMSU4a0zf6XOnR9AnM+E5TZNvxo=";
        examplePerson.Data["auth_Type"] = AuthenticationType.FormsAuthentication;
        examplePerson.Data["auth_Account"] = "exmpl";
        examplePerson.Data["auth_HashedPassword"] = PasswordHashUtility.CalculateHash("test_password", saltExample);
        examplePerson.Data["auth_Salt"] = saltExample;
        examplePerson.Data["auth_MustChangePassword"] = true;

        examplePerson.Data["auth_"] = "this is an example";
        // Create examplePerson in database
        client.Persons.Create(examplePerson);

        // get person from db
        var loadedPersonExample = client.Persons.Get(examplePerson.Id, "auth_");
        Console.WriteLine(loadedPersonExample.Name);

        // Disconnect from server
        client.Disconnect();
    }
}
The following example illustrates how SimpleClient provides person by Id by null data prefix
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 new Example Person
        var examplePerson = new SimplePersonV1(
            Guid.NewGuid(),
            EntityRoot.Person,
            PersonCategory.Person);
        examplePerson.Data["Surname"] = "Example";

        // Create examplePerson in database
        client.Persons.Create(examplePerson);

        // get person from db
        var loadedPersonExample = client.Persons.Get(examplePerson.Id, null);
        Console.WriteLine(loadedPersonExample.Name);

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

Reference

PersonRepository Class
Get Overload
Gamanet.C4.SDK Namespace