Person |
Search presons by search text.
Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public ISimpleCollection<SimplePersonV1> SearchAll( string searchText, Properties properties, bool includeArchived )
Parameters
- searchText String
- Text to search.
- properties Properties
- The properties.
- includeArchived Boolean
- if set to true include archived.
Return Value
ISimpleCollection<SimplePersonV1>Collection of person ids
Implements
ISimpleClientPersonRepositoryV3.SearchAll(String, Properties, Boolean)Example
This example demonstrates how to search for persons using a search text, with optional filtering properties and an 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(); // Create new Example Person var examplePerson1 = new SimplePersonV1( Guid.NewGuid(), EntityRoot.Person, PersonCategory.Person); examplePerson1.Data["FirstName"] = "Peter"; examplePerson1.Data["Surname"] = "Example"; examplePerson1.Archived = false; // Create new Example Person, this one will be archived var examplePerson2 = new SimplePersonV1( Guid.NewGuid(), EntityRoot.Person, PersonCategory.Person); examplePerson2.Data["FirstName"] = "Peter"; examplePerson2.Data["Surname"] = "ExampleSecond"; examplePerson2.Archived = true; // Create examplePerson in database client.Persons.Create(examplePerson1); client.Persons.Create(examplePerson2); // Retrieve all person named 'Peter', including archived persons var exampleSearchText = "Peter"; var exampleResult = client.Persons.SearchAll(exampleSearchText, Properties.None, true); // Result should contain both names for example person 1 and example person 2 foreach (var resultPerson in exampleResult) { Console.WriteLine(resultPerson.Name); } // Disconnect from server client.Disconnect(); } }
See Also