RegionRepositoryV4.GetAllByDevice Method

Retrieves all regions associated with a specific device.

Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public ISimpleCollection<SimpleRegionV1> GetAllByDevice(
	Guid deviceId,
	Properties properties
)

Parameters

deviceId  Guid
The ID of the device.
properties  Properties
The properties to include in the result.

Return Value

ISimpleCollection<SimpleRegionV1>
A collection of regions associated with the device.

Implements

ISimpleClientRegionRepositoryV4.GetAllByDevice(Guid, Properties)
Example
This example demonstrates how to get all regions for selected device, with an option to filter properties.
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 loadedRegionsAll = client.Regions.GetAllByDevice(exampleCardReader.Id, Properties.All);

        var loadedRegionsBasic = client.Regions.GetAllByDevice(exampleCardReader.Id, Properties.Basic);

        var loadedRegionsNone = client.Regions.GetAllByDevice(exampleCardReader.Id, Properties.None);
        Assert.IsNotNull(loadedRegionsAll);
        Assert.IsNotNull(loadedRegionsBasic);
        Assert.IsNotNull(loadedRegionsNone);

        Assert.AreEqual(1, loadedRegionsAll.Count);
        Assert.AreEqual(1, loadedRegionsBasic.Count);
        Assert.AreEqual(1, loadedRegionsNone.Count);

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

Reference

RegionRepositoryV4 Class
Gamanet.C4.SDK Namespace