Device |
Search device Ids 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<Guid> Search( string searchText )
Parameters
- searchText String
- Text to search.
Return Value
ISimpleCollection<Guid>Collection of device ids
Implements
ISimpleClientDeviceRepositoryV3.Search(String)Example
The following example illustrates how SimpleClient search devices by device name
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 Device var exampleDevice = new SimpleDeviceV1( Guid.NewGuid(), "BUS CONTROLLER", EntityRoot.Device, Guid.Parse("9c2246aa-5d43-414f-85d4-8c3b4e657236") ); // Create device under device root in db client.Devices.Create(exampleDevice); Console.WriteLine($"Example Device GUID is: {exampleDevice.Id}"); // Print out the device ID for comparison with result Console.WriteLine(exampleDevice.Id); var result = client.Devices.Search("bu"); foreach (var deviceGuid in result) { Console.WriteLine(deviceGuid); } // Disconnect from server client.Disconnect(); } }
See Also