Skip to main content

Connections.GetConnectionByNameAsync

Description

Gets the specified connection from the connected Control Room

Signature [C#]

Task<Connection> GetConnectionByNameAsync(string name)

Properties

Input

PropertyDescription
nameSpecify the name of the connection to be retrieved.

Output

PropertyDescription
Task<Connection>Returns the details of the specified connection.

Remarks

Use GetConnectionByNameAsync API to get information about the connection from the connected Control Room.

Example

C#
public void GetConnectionByName()
{
IControlRoomContext context = LoginControlRoom();

string connectionName = "demo_connection";

var connection = Task.Run(() => context.Connections.GetConnectionByNameAsync(connectionName)).Result;
Console.WriteLine("Connection Value: " + connection.Value);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}