CredentialRepositoryV3.SearchTransferableCredential Method

Search transferable credentials

Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public ISimpleCollection<CredentialV1> SearchTransferableCredential(
	Guid personId,
	string searchText,
	bool includeAssigned
)

Parameters

personId  Guid
person identifier.
searchText  String
Text to search.
includeAssigned  Boolean
if set to true include assigned credentials.

Return Value

ISimpleCollection<CredentialV1>
Credentials

Implements

ISimpleClientCredentialRepositoryV3.SearchTransferableCredential(Guid, String, Boolean)
Example
This example demonstrates how to search for transferable credentials associated with a given person, using optional search text and an option to include already assigned credentials.
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";

        client.Persons.Create(examplePerson);
        // You have to install package for credential type first
        // Create example credential data
        var exampleCard = new CredentialV1(Guid.NewGuid(), exampleCredentialTypeId) // CredentialCategory.Card
        {
            Code = "0x457",
            Name = "ExampleCard",
            OwnerId = EntityRoot.Person,
            HolderId = examplePerson.Id, // Undefined holder for example purposes
            Status = CredentialStatus.Enabled
        };
        // Create credential in database
        client.Credentials.Create(exampleCard);

        var result = client.Credentials.SearchTransferableCredential(examplePerson.Id, "", true);

        foreach (var item in result)
        {
            Console.WriteLine(item.Name);
        }

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

Reference

CredentialRepositoryV3 Class
Gamanet.C4.SDK Namespace