Skip to main content

Connections.GetAllConnectionsByTypesAsync

Description

Gets the specified connection from the connected Control Room

Signature [C#]

Task<List<Connection>> GetAllConnectionsByTypesAsync(List</string/> connectionTypes)

Properties

Input

PropertyDescription
connectionTypesSpecify the list of the connection types to query.

Output

PropertyDescription
Task<List<Connection>>Returns the queried connections.

Remarks

Use GetAllConnectionsByTypesAsync API to get the connections based on the connection type from the connected Control Room.

Example

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

string connectionName = "demo_connection";

var Lis<connection> connections = Task.Run(() => context.Connections.GetAllConnectionsByTypesAsync(new List<string>(){"Email Server"})).Result;
Console.WriteLine("Email server connections count: " + connections.Count);
}
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;
}